Monday, November 25, 2024

script – Applescript: Batch Rename Songs in Apple Music

The other day, I was downloading a playlist from youtube with yt-dlp (I recommend, it’s the best up-to-date cli yt batch downloader out there.). I then renamed the files with python, which was fine, see screenshot.
Files in finder

And then I imported them to apple music. Which was when the problems began. I’ve got 95 files in music and they all don’t have a track number, and they have a number before their name.
I decided to go through and add the track numbers myself because it was fairly quick.
enter image description here
Then I needed to remove the first 3 characters from each song, because they contain a number and a space that I don’t need.

My first thought was to use Doug’s Applescripts.
Remove N chars script
but I am using MacOS 10.15 so this script is too new.
He also has an older version but it only works with itunes, and i have apple music installed instead.

So then I thought: why don’t I write my own applescript?
But I have no idea how to do that. Anyone have any ideas?

P.S: I tried learning it online but I can’t find any stuff on batch renaming files in apple music with applescripts.

Thx!

Related Articles

Latest Articles