# Can this be done via a script?

**URL:** <https://community.mp3tag.de/t/can-this-be-done-via-a-script/45177>\
**Category:** Support\
**Created:** [April 18, 2019, 4:32pm UTC](https://community.mp3tag.de/t/can-this-be-done-via-a-script/45177 "2019-04-18T16:32:47Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![hopkins](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/838e76/32.png) [@hopkins](https://community.mp3tag.de/u/hopkins)\
**Post date:** [April 18, 2019, 4:32pm UTC](https://community.mp3tag.de/t/can-this-be-done-via-a-script/45177/1 "2019-04-18T16:32:47Z")

</div>

Hello,

I am saving in text files (markdown format) artist information in my music folders. Each folder contains a file "credits.md", with the list of musicians in a format similar to what can be found in wikipedia. For example:

- J.J. Johnson - trombone
- Tommy Flanagan - piano (tracks 1 - 7)
- Paul Chambers - bass (tracks 1 - 6, 8 - 13)

or in more elaborate cases, I add a "session" number in a tag, and have multiple "sessions" in the same file (each session is identified in brackets []):

[1] Tracks 1-8, Rec. Capitol Studios, NYC, February 6, 1964

- Grady Tate - Drums
- Gus Johnson - Drums
- Ernie Shepard - Bass
- Johnny Hodges - Alto Saxophone
- Harry Carney - Baritone Saxophone
- Russell Procope - Alto Saxophone
- Herbie Jones - Trumpet
- Ray Nance - Trumpet

[2] Tracks 9-16, Lawrence Brown's All-Stars With Johnny Hodges

Rec. Van Gelder Studio, Englewood Cliffs, NJ, March 8, 1965

- Ray Nance - cornet
- Cat Anderson - trumpet
- Lawrence Brown, Buster Cooper - trombone
- Johnny Hodges - alto sax
- Russell Procope - alto sax, clarinet
- Harold Ashby, Paul Gonsalves - tenor sax
- Jimmy Jones - piano
- Richard Davis - bass
- Gus Johnson - drums
- Johnny "Brother" Hodges - drums (tracks 11,12)

Is it possible to write a script to import a file in that format, parse it, and update the tags for a given album ?

I would rather not invest time in understanding the scripting functions if at the end of the day this is not possible. So if someone who knows the scripting language well could give me his/her opinion, it would save me a lot of time...

Thanks

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [April 18, 2019, 5:19pm UTC](https://community.mp3tag.de/t/can-this-be-done-via-a-script/45177/2 "2019-04-18T17:19:12Z")

</div>

It is not quite clear what you mean with

> [@hopkins](#):
>
> update the tags for a given album

I do not see that you name any tag fields.  
But: if you want to copy all of the data of the text file into a single field (e.g. INVOLVEDPEOPLE) in each file, the you simply use an action of the type  
"Import text file", see the help:

> **[Import Text File – Mp3tag Documentation](https://docs.mp3tag.de/actions/import-text/)**
>
> Documentation on the Import Text File action type that can be performed as Quick Action or as reusable workflow from Action Groups. Mp3tag is the universal Tag Editor.

The format should be a simple text file - or you would have to write some other actions to get rid of the meta-information.

---

<div class="post-metadata">

**Author:** ![hopkins](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/838e76/32.png) [@hopkins](https://community.mp3tag.de/u/hopkins)\
**Post date:** [April 18, 2019, 5:21pm UTC](https://community.mp3tag.de/t/can-this-be-done-via-a-script/45177/3 "2019-04-18T17:21:44Z")

</div>

Thanks for replying. I did not "specify" which tag I would use as I assumed that was not relevant, but I would use the tag "BAND".

When you say "you would have to write some other actions to get rid of the meta-information". Would/could that be done in scripting function ?

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [April 18, 2019, 5:31pm UTC](https://community.mp3tag.de/t/can-this-be-done-via-a-script/45177/4 "2019-04-18T17:31:21Z")

</div>

> [@hopkins](#):
>
> I would use the tag "BAND".
> 
> When you say "you would have to write some other actions to get rid of the meta-information". Would/could that be done in scripting function ?

"BAND" is no standard tag field - you would probably not see it in most players.  
Have a look at the help to see the supported and standard tag fields:

> **[Tag Field Mappings – Mp3tag Documentation](https://docs.mp3tag.de/mapping/)**
>
> Overview of all available tag fields, their names in Mp3tag, and how they are mapped to the internal structures of the different tag formats. Mp3tag is the universal Tag Editor.

And scripting: again: the source has to be some kind of text file. Any binary format like the formatted output of a word processor will most likely not work.  
If you use e.g. HTML as output format, you would have to get rid of all the `<h1>, <LI> and <p>` inserts. Or you save the file as real plain text anyway.  
To import the data I would choose a field that allows a multiline display in the player - and there are not that many. Probably the most widespread one would be UNSYNCEDLYRICS, yet the type of information that I see is more suitable for INVOLVEDPEOPLE - which sadly is shown by hardly any player.

---

<div class="post-metadata">

**Author:** ![hopkins](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/838e76/32.png) [@hopkins](https://community.mp3tag.de/u/hopkins)\
**Post date:** [April 18, 2019, 5:41pm UTC](https://community.mp3tag.de/t/can-this-be-done-via-a-script/45177/5 "2019-04-18T17:41:40Z")

</div>

Thanks. Once again, I do not believe the choice of tag is relevant. I would like to update the "BAND" tag because I use LMS (Logitech Media Server), and the choice of tags is limited. As for the content of the tag, I plan on putting multiple entries seperated by a character, which is something that LMS recognizes and is able to split. For example: the BAND tag in my first example would end up containing:

J.J. Johnson / Tommy Flanagan / Paul Chambers

Now, the source is a text file. It is not a binary format. The source contains exactly what I posted above, which is text. A markdown format is NOT html, it is simply text, with some added symbols (ex: \* in front of each line containing names of artists).

Back to my question: does someone know if this can be done ?

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [April 18, 2019, 5:43pm UTC](https://community.mp3tag.de/t/can-this-be-done-via-a-script/45177/6 "2019-04-18T17:43:29Z")

</div>

Use an action of the type "Import text file".  
(I think I already linked the relevant help chapters, so it would be nice if you could have a look at them).

---

<div class="post-metadata">

**Author:** ![hopkins](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/838e76/32.png) [@hopkins](https://community.mp3tag.de/u/hopkins)\
**Post date:** [April 18, 2019, 5:45pm UTC](https://community.mp3tag.de/t/can-this-be-done-via-a-script/45177/7 "2019-04-18T17:45:42Z")

</div>

Thanks, but I have already used before "import text file", and you need to specify a format with the filename of each music file, which is not what is contained in my text files.

I have a text file in a music folder, which simply contains a list of musicians, in a specific format, and I just wanted to know if that can somehow be used in a script to update a tag.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [April 18, 2019, 5:48pm UTC](https://community.mp3tag.de/t/can-this-be-done-via-a-script/45177/8 "2019-04-18T17:48:24Z")

</div>

Not quite.  
If you want to import the contents of the same file into the same field in several files then

- select those files
- select the action "import text file"
- set the fixed name (which also could be %album%.txt)
- select the target field  
Click OK

---

<div class="post-metadata">

**Author:** ![hopkins](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/838e76/32.png) [@hopkins](https://community.mp3tag.de/u/hopkins)\
**Post date:** [April 18, 2019, 5:50pm UTC](https://community.mp3tag.de/t/can-this-be-done-via-a-script/45177/9 "2019-04-18T17:50:26Z")

</div>

OK, thanks. Now in the import process, do you think that the scripting language is sufficiently flexible to:

- parse lines as the ones I indicated
- collate them into a tag
- potentially only update the relevant files based on a correspondance with another tag (ex: a custom "session" tag) ?

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [April 18, 2019, 5:53pm UTC](https://community.mp3tag.de/t/can-this-be-done-via-a-script/45177/10 "2019-04-18T17:53:04Z")

</div>

you have full range of text manipulating functions, see

> **[Scripting Functions – Mp3tag Documentation](https://docs.mp3tag.de/scripting/#string-functions)**
>
> Documentation on Mp3tag's scripting functions. Mp3tag is the universal Tag Editor.

or regular expressions, see

> **[Replace with Regular Expression – Mp3tag Documentation](https://docs.mp3tag.de/actions/replace-regexp/)**
>
> Documentation on the Replace with Regular Expression action type that can be performed as Quick Action or as reusable workflow from Action Groups. Mp3tag is the universal Tag Editor.

I would import the raw data into the tag field and then transform it into a suitable format.

---

<div class="post-metadata">

**Author:** ![hopkins](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/838e76/32.png) [@hopkins](https://community.mp3tag.de/u/hopkins)\
**Post date:** [April 18, 2019, 5:54pm UTC](https://community.mp3tag.de/t/can-this-be-done-via-a-script/45177/11 "2019-04-18T17:54:15Z")

</div>

I guess I was just asking for an "educated guess", based on what I explained, to avoid the effort of spending a lot of time to understand the scripting language only to find out it could not be done.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [April 18, 2019, 5:57pm UTC](https://community.mp3tag.de/t/can-this-be-done-via-a-script/45177/12 "2019-04-18T17:57:21Z")

</div>

I would think that it can be done - but then again, if one knows which functions are available, one might modify the workflow so that not too much of the original idea is left. Who knows.

Just one thing: MP3tag only knows the current track. It does not know anything about "albums". So it may be that such a summarizing piece of data is not suitable in respect to context, not in respect to scripting.

---

<div class="post-metadata">

**Author:** ![hopkins](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/838e76/32.png) [@hopkins](https://community.mp3tag.de/u/hopkins)\
**Post date:** [April 18, 2019, 6:03pm UTC](https://community.mp3tag.de/t/can-this-be-done-via-a-script/45177/13 "2019-04-18T18:03:11Z")

</div>

OK, thanks. I do not think handling it track by track would be an issue.

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [February 9, 2026, 12:28pm UTC](https://community.mp3tag.de/t/can-this-be-done-via-a-script/45177/14 "2026-02-09T12:28:02Z")

</div>


