Popular Now
downloaded 6m 32s ago
For Music Recreate a playlist such that its visible columns mirror the Music library
downloaded 16m 17s ago
For Music Apply extant image metadata from tracks' files as track artwork
downloaded 20m 54s ago
For Music Exports and then re-imports selected tracks' artwork
downloaded 21m 17s ago
For iTunes Exports and then re-imports selected tracks' artwork
downloaded 22m 59s ago
For iTunes Detects if a track's file's metadata contain image information
downloaded 24m 33s ago
Artwork as Album Folder Icon v1.2
For iTunes Assigns track artwork as icon for corresponding file's folder
Welcome!
Download hundreds (632 and counting) of AppleScripts for Apple's Media Apps that will help make managing your digital music and video collection easier and more fun!
What's AppleScript?
AppleScript is a simple Macintosh-only programming language that can control and automate actions on your Mac. AppleScript is already available on your computer as part of the macOS and many popular applications can be automated using AppleScript scripts. Scripts written for Apple's Music, TV and iTunes apps can manage files and track information, create playlists, interact with other applications, perform innovative tasks, and handle many kinds of chores with accuracy and precision which otherwise would be repetitive, laborious, and/or time-consuming.
Cool! Where Do I Start?
Start browsing the site by using the scripts ↓ Menu link above. AppleScripts are gathered into these general Categories:
- Managing Tracks
- Managing Track Info
- Managing Artwork
- Managing Playlists
- Controlling iTunes
- Exporting Info
- Managing Files
- Networking
- Internet
- iPod (iPhone/iPad)
- Miscellaneous
- With Other Apps
Or use the search box at the top of every page to try and find something specific.
Not sure how to install AppleScripts? Here's a Download/Installation FAQ.
Check back often or subscribe to my RSS blog feed and Most Recent Scripts RSS feed to stay notified about new and updated scripts and info.
Latest:
RSS ROOLZ! SUBSCRIBE!
UPDATED: Albums Amiss v1.4
This script uses track information to calculate whether a particular batch of tracks with the same Album title represent an incomplete or over-complete album, with either too few or too many requisite album tracks. Also, albums with missing Track and Disc information will be considered "amiss". Such batches will be copied to a discrete results playlist where they can be examined. The entire Music library or a selected Smart playlist can be scanned. (To be clear: the script does not check some kind of online database; it uses the extant local track entry information. Thus, tag accuracy is essential.)

Latest version:
- Fixed an issue displaying 0 results
- Accommodation for macOS 26/Tahoe
More information for Albums Amiss v1.4 and download link is here.
Count Selected Tracks in Songs View?
Did I tell you that, evidently, the Music app doesn't show the number of selected tracks in the playlist's Status Bar when the playlist is in Songs View? Yup.
Wait, it doesn't show the Status Bar at all when the playlist is in Songs View. Luckily, no chains can keep me from writing this simple AppleScript:
tell application "Music"
try
set sel to selection
set numberOfSelected to (count of sel)
set s to " tracks"
if numberOfSelected is 1 then set s to " track"
display dialog ((numberOfSelected & s & " selected") as text)
end try
end tell
Comes out like this:

Apple TV AppleScript is Busted
Correspondents have been reporting that scripts which were working fine with the TV app pre-Tahoe are now not working very well at all. After finally getting around to having a look, I can confirm that things like "get view of front browser window" and getting a selection—essentially the way to get the selected playlist or the selected tracks in the TV app—do not work. You will invariably see a "No tracks selected" alert under such circumstances.
As you were.
UPDATED: Playlist XML Librarian v1.1
Playlist XML Librarian will list exported Playlist XML files collected in a specified folder with options to view, search and send (import) them to the Music app. Makes it easy to maintain an organized stockpile of exported Playlist XMLs to reduce the number of onboard Music playlists.
I use this thing regularly myself. So, you can imagine.
Also see Playlist XML Viewer which displays a single selected Playlist XML drag-and-dropped or chosen from any location.

Latest version:
- Adds "Delete" command
- Added Expand/Collapse buttons for source list
- Adds setting to expand all folders at launch
- Better detection of loaded playlists
- Fixed problem with progress bar traveling
- Fixed issue with correct Total Time calculation
- Fixed some autoresizing issues
More information for Playlist XML Librarian v1.1 and download link is here.
Album Art Makes My Year In Review
The Photos app just notified me that it has prepared a special "Year In Review" album or something. The notification also contained a sample photo, no doubt meant to trigger a longing to see all them pitchers I took this year. But the picture was the cover of Bruce Springsteen's "Darkness on the Edge of Town" album. Which on first glance was bewildering.

I forgot that I exported a kabillion album covers into Photos with the Save Album Art to Photos script.
Swap Light-Dark Modes
Just did some fiddlin' with the site to make it a little responsive to dark mode settings. So, to celebrate, here's a script to swap modes rather than jogging into System Settings whenever. I have it in the system-wide Scripts menu.
Folder Action to Add Files to Year/Month Folders
So now that I'm a Playlist XML exportin' maniac, I created a Folder Action to automatically file the exports to my "Playlist Exports" folder into Year/Month folders, according the date of save. Here it is. When a file is added to the folder the script is attached to, it moves it to a newly-created or existing Year/Month hierarchy:
on adding folder items to thisFolder after receiving theseItems
repeat with anItem in theseItems
tell me to processThis(anItem, thisFolder)
end repeat
end adding folder items to
to processThis(anItem, thisFolder)
set yearMonthPath to (do shell script "date '+%Y:%m_%b'") as text
-- Y=year, m=month number (for sorting), b=month abreviation. eg, 2025:06_Jun
try
set folderPath to (thisFolder & yearMonthPath) as text
tell application "Finder"
try
exists folder (folderPath as POSIX file as alias)
on error
do shell script "mkdir -p " & quoted form of POSIX path of (folderPath as text)
end try
move anItem to folder folderPath with replacing
end tell
end try
end processThis
UPDATED: Playlist XML Viewer v1.1
It occurred to me I ought to add drag-and-drop to Playlist XML Viewer.
Open (or drag-and-drop) and view the contents of a playlist XML file exported from the Music app in a conventional table layout. Includes options to send (import) the XML in the Music app, export a TXT, CSV or M3U version, copy info to clipboard and reveal existing files in the Finder. (Not for use with exported Library XML files.)
Also see Playlist XML Librarian which can manage a folder-full of exported Playist XML files.

Latest version:
- A single XML file can be drag-and-dropped onto the window to open it
- Adds XML size and total time of tracks to window display
- Adds more versatility to columns
More information for Playlist XML Viewer v1.1 and download link is here.
NEW: Playlist XML Librarian
I don't know what I've been thinking over the years not using exported Playlist XMLs to offload and store superfluous playlists.
For a couple of years recently, I did a weekly two hour streaming radio show. I created a playlist of songs for a each show and kept the playlists in a "Shows Folder" in the Music app. All one hundred or so of them. I didn't want to delete them. But having them around, even inside a Playlist Folder, didn't make a lot of sense either. So it occurred to me to just export them as XML files and keep them Just In Case.
After exporting a few, as mentioned previously, I assigned a Command-E keyboard shortcut to Music app's File->Library->Export Playlist... command. That restored about six weeks to my life.
Once all the playlists were offloaded and deleted from Music, Man, oh Boy, did I feel great.
But then it occurred to me that if or when I ever wanted to reload a Playlist XML I wouldn't be able to know what tracks were in it. Unless I loaded it in Music first. That would be dumb. So I whipped up Playlist XML Viewer, which could load an exported Playlist XML so I could look at it in a table format. Boy, was I cruising on a wave of joy.
But then it occurred to me that...
Well. Perhaps you can imagine what I needed to do:

Playlist XML Librarian will list the exported Playlist XML files collected in a specified folder with options to view, search and send (import) them to the Music app. Makes it easy to maintain an organized stockpile of exported Playlist XMLs to reduce the number of onboard Music playlists.
More information for Playlist XML Librarian and download link is here.
Select None Lives
Did I say there was no "Select None" in Music app's Edit menu? Something had to be done.
tell application "Music"
tell (get view of front browser window)
try
reveal track 1 of it
reveal track 1 of it
end try
end tell
end tell
Run this when tracks are selected in a playlist and muscle memory has you going for Shift-Command-A. It first selects (reveal) the first track of the playlist, which clears any other selection. Then, (because of a bug?) the reveal command run a second time de-selects the first track, leaving no tracks selected.



