Created
May 14, 2022 06:13
-
-
Save idiomatic/cccc14c0f038c7c33219c57f8502c60b to your computer and use it in GitHub Desktop.
AppleScript to remove artist prefix from track name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Music" | |
repeat with trk in selection | |
set oldName to name of trk | |
set prefix to (artist of trk) & " - " | |
if oldName starts with prefix then | |
set len to length of oldName | |
set newName to (get characters (get length of prefix) thru len of oldName as string) | |
set name of trk to newName | |
end if | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment