# Batch Update of Album Name

**URL:** <https://community.mp3tag.de/t/batch-update-of-album-name/43287>\
**Category:** Support\
**Created:** [October 16, 2018, 1:37pm UTC](https://community.mp3tag.de/t/batch-update-of-album-name/43287 "2018-10-16T13:37:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jc2259](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/f07891/32.png) [@Jc2259](https://community.mp3tag.de/u/Jc2259)\
**Post date:** [October 16, 2018, 1:37pm UTC](https://community.mp3tag.de/t/batch-update-of-album-name/43287/1 "2018-10-16T13:37:48Z")

</div>

iTunes shows my album names in the format "(2018) - greatest Hits", in other words the albums year in brackets followed by the album name. this Album name tag is held within the iTunes library, I would like to update the relevant tag within the actual MP3 file name, this is doable from within the MP3TAG application but with over 12,000 albums collected and digitised over many years I would like to put a script together that will do a batch update taking the iTunes Album name and applying it to the MP3 file, I wrote an AppleScript for iTunes on my Apple Mac which updated the album name so I just need to know the terminal/command line script/command. if some one could help please.

---

<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:** [October 16, 2018, 4:05pm UTC](https://community.mp3tag.de/t/batch-update-of-album-name/43287/2 "2018-10-16T16:05:23Z")

</div>

> [@Jc2259](#):
>
> so I just need to know the terminal/command line script/command.

There is no such thing as a command line to update fields/tags.  
You would have to get iTunes to write all its information to the tags - in the old days this could be achieved with the iTunes function to change the tag type - even from V2.3 to V2.3 - so no change happened but the information still ended up in the files. You have to try if this function is still available.

---

<div class="post-metadata">

**Author:** ![Jc2259](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/f07891/32.png) [@Jc2259](https://community.mp3tag.de/u/Jc2259)\
**Post date:** [October 20, 2018, 9:55am UTC](https://community.mp3tag.de/t/batch-update-of-album-name/43287/3 "2018-10-20T09:55:04Z")

</div>

Thanks ohrenkino for the reply, I am very good with AppleScript and iTunes, so I wrote a script that does exactly that, it applies the relevant details to the Album name and saves the details in the iTunes library but unfortunately it does not actually update the tags within the MP3 files.

If anyone would like a copy of my AppleScript please reply and I will make it available for free. what follows is a copy/paste of the script but happy to zip it etc.

(\*

26 Artists Place Album Year Number in front of Album Name where no open bracket exists

\*)

**tell** _application_ "Finder"

**set** {TID, AppleScript's text item delimiters} **to** {AppleScript's text item delimiters, ":"}

**set** AppName **to** ( _text item_ -1 **of** ( _text_ 1 **thru** -6 **of**  **the** ( **path to**  **me** as _string_ )))

**set** AppleScript's text item delimiters **to** TID

**display notification**"Procedure Started: " & return & AppName with title "Information Messge"

**delay** 1

**end**  **tell**

**set** progress total steps **to** -1

**set** progress completed steps **to** -1

**set** progress description **to**"Updating Album Name from Year number & Album Name:"

**set** progress additional description **to**"Preparing to process..." & return

**tell** _application_ "iTunes"

**set** sel **to** ( **every** _file track_ **of** _playlist_ "Library" **whose** album **does not**  **start with**"(")

-- set sel to selection

**set** selR **to**  **a reference**  **to** sel

**if** sel **is** {} **then**

**display dialog** return & "No albums are selected..." buttons {"Cancel"} default button 1 with icon 0 giving up after 15

**return**

**end**  **if**

**tell**  **me**  **to** {progress description, progress additional description}

**set** Procedurestartdate **to**  **current date**

**set** number\_of\_tracks\_to\_process **to** (length **of** sel)

**log**"number\_of\_tracks\_to\_process = " & number\_of\_tracks\_to\_process

**set** number\_of\_albums\_to\_process **to** 0

**set** number\_of\_albums\_processed **to** 0

**set** list\_Of\_Album\_Names **to** {}

**set** new\_Album\_Name **to**""

**set** the\_artist\_name **to**""

**set** other\_chars **to**"()"

**set** {TID, AppleScript's text item delimiters} **to** {AppleScript's text item delimiters, ":"}

**repeat**  **with** i **from** 1 **to** number\_of\_tracks\_to\_process

-- get number of albums to be processed

**set** Current\_Track **to** _item_ i **of** selR

**set** current\_Album\_Name **to** (Current\_Track's album **as** _string_ )

**log**"current\_Album\_Name - " & current\_Album\_Name

**if** list\_Of\_Album\_Names **does not**  **contain** current\_Album\_Name **then**

**copy** current\_Album\_Name **to**  **end**  **of** list\_Of\_Album\_Names

**set** number\_of\_albums\_to\_process **to** number\_of\_albums\_to\_process + 1

**end**  **if**

**end**  **repeat**

**log**"Number of albums = " & number\_of\_albums\_to\_process

**tell**  **me**  **to**  **set** progress total steps **to** number\_of\_tracks\_to\_process

**set** completedsteps **to** 0

**tell**  **me**  **to** dispmsg(1, number\_of\_tracks\_to\_process, -1, number\_of\_albums\_to\_process, number\_of\_albums\_processed, "", "")

**repeat**  **with** i **from** 1 **to** number\_of\_tracks\_to\_process

**log**"track number = " & i & " of " & number\_of\_tracks\_to\_process

**set** thisTrack **to** _item_ i **of** selR

**set** theFileLocation **to** { **get** thisTrack's location}

**set** the\_artist\_name **to** { **get** thisTrack's artist} **as** _string_

**set** the\_Album\_Name **to** { **get** thisTrack's album} **as** _string_

-- log "thealbum - " & the\_Album\_Name

**set** the\_Track\_year **to** { **get** thisTrack's year}

-- log "thetrackyear - " & the\_Track\_year

**set** new\_Album\_Name **to**"(" & the\_Track\_year & ") - " & the\_Album\_Name

**set** thisTrack's album **to** new\_Album\_Name

**set** number\_of\_albums\_processed **to** number\_of\_albums\_processed + 1

**set** completedsteps **to** completedsteps + 1

**tell**  **me**  **to** dispmsg(i, number\_of\_tracks\_to\_process, completedsteps, number\_of\_albums\_to\_process, number\_of\_albums\_processed, the\_artist\_name, the\_Album\_Name)

**end**  **repeat**

**set** AppleScript's text item delimiters **to** TID

**set** Text\_To\_Be\_Read\_Out **to**"procedure complete" **as** _text_

**say** Text\_To\_Be\_Read\_Out

**set** ProcedureEndDate **to**  **current date**

**if** Procedurestartdate \> ProcedureEndDate **then**

**set** time\_Difference\_in\_seconds **to** Procedurestartdate - ProcedureEndDate

**else**

**set** time\_Difference\_in\_seconds **to** ProcedureEndDate - Procedurestartdate

**end**  **if**

**set** Total\_seconds\_of\_Run\_Time **to** time\_Difference\_in\_seconds

**set** Total\_Hours **to** (time\_Difference\_in\_seconds **div** hours)

**set** Total\_minutes **to** (time\_Difference\_in\_seconds **div** minutes)

**if** Total\_Hours **is**  **equal to** 1 **or** Total\_Hours **is**  **greater than** 1 **then**

**set** Total\_minutes **to** Total\_minutes - (Total\_Hours \* 60)

**log**"Total minutes " & Total\_minutes

**end**  **if**

**set** Total\_Seconds **to** (time\_Difference\_in\_seconds **mod** minutes)

**set** ElapsedTimeDisplay **to**"Elapsed time: " & Total\_Hours & " Hours " & Total\_minutes & " Minutes " & Total\_Seconds & " Seconds"

**display dialog**"Procedure Complete. " & return & return & number\_of\_albums\_to\_process & " Album Names Updated" & return & return & "Started at: " & Procedurestartdate & return & return & "Compleated at: " & ProcedureEndDate & return & return & ElapsedTimeDisplay buttons {"Thank You"} default button 1 with title AppName with icon 1

**end**  **tell**

**on** dispmsg(i, number\_of\_tracks\_to\_process, completedsteps, number\_of\_albums\_to\_process, number\_of\_albums\_processed, the\_artist\_name, the\_Album\_Name)

**set** progress additional description **to** return & "Album Details:- " & return & return & "Total Number of Albums to Process: " & number\_of\_albums\_to\_process & return & return & "Track Number: " & i & " of " & number\_of\_tracks\_to\_process & return & return & "Artist: " & the\_artist\_name & return & return & "Album: " & the\_Album\_Name & return & return & "Updating iTunes Library" & return

**delay** 0.2

**set** progress completed steps **to** completedsteps

**end** dispmsg

---

<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:27pm UTC](https://community.mp3tag.de/t/batch-update-of-album-name/43287/4 "2026-02-09T12:27:43Z")

</div>


