Skip to content

Instantly share code, notes, and snippets.

@idiomatic
Created May 14, 2022 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idiomatic/cccc14c0f038c7c33219c57f8502c60b to your computer and use it in GitHub Desktop.
Save idiomatic/cccc14c0f038c7c33219c57f8502c60b to your computer and use it in GitHub Desktop.
AppleScript to remove artist prefix from track name
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