Download 446 (and counting) free user-contributed AppleScripts for Apple's iTunes that will help make managing your digital music collection easier and more fun!
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 Mac OS and many popular applications can be automated using AppleScript scripts. Scripts written for iTunes can manage files and track information, create playlists, interact with other applications, perform innovative tasks, and handle many kinds of chores 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
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 the Download/Installation FAQ.
Copy Tracks to Multiple Playlists v2.2 will copy the selected iTunes tracks to one or more chosen playlists.
This latest version makes some tweaks for compatibility with OS X 10.9.
More info and download here.
Last night, Apple released iTunes 11.1.3 which fixes some issues with the Equlaizer and switchiong views in large libraries (what’s a “large” library?) and other minor bugs. Available via software update, the App Store app, or directly download from Apple’s website.
A Correspondent writes that he sorts his Music library playlist by Date Added and meticulously adds each new album’s worth of files to iTunes in reverse order—one file at a time—so that an album will appear in order (well, the order established for them in the Finder); older tracks appear sorted lower in the Music library playlist than newer tracks. Get me?
Predictably, Our Correspondent is dismayed by the drudgery of this method and inquires if AppleScript can provide any relief. AppleScript provide relief from drudgery? Ahoy!
tell application “Finder”
set selectedFiles to selection
repeat with i from (length of selectedFiles) to 1 by -1
my addFile(item i of selectedFiles)
tell application “iTunes”
add aFile as alias
Save this as a Script Bundle—named whatever you like—to your ~/Library/Scripts/ folder. This will make the script available in the system-wide Scripts menu at the right side of the menu bar. Select the files in the Finder you want to add, which have been sorted in the order you want, and launch the script. It will add the files to iTunes in reverse order so that when they are sorted by Date Added in iTunes they appear in the order you had for them in the Finder.
UPDATE November 11, 2013: Added 1 second delay in repeat loop to prevent tracks from having the same date added (to the second) and sorting arbitrarily.
Via Kirk: for whatever reason, iTunes 11.1.2 removed the restriction on editing tags of tracks in a mixed-media selection.
The bug affecting AirPlay scripting has been fixed in iTunes 11.1.2.
Some Correspondents using Mavericks are reporting that downloaded scripts are regarded as damaged by the OS. I suspect it is a codesigning issue. This doesn’t affect downloading to systems before OS X 10.9. I’m investigating and testing to rule out other possibilities.
UPDATE (4:15PM): Looks like this is just affecting Remove n Characters From Front or Back v4.7. Mavericks wasn’t happy with the way it was packaged. So I recompiled, rebuilt the .dmg, and re-zipped. That script should be fine now. Wish I could say I knew for certain that it’s the only one affected.
UPDATE (4:45PM): Looks like Save Album Art to Album Folder, one I posted today, is also corrupted in Mavericks. I’ve fixed it.
Save Album Art as folder.jpg will export the artwork of the selected tracks or tracks in the selected playlist as a JPEG image file named folder.jpg to the folder which contains each selected track’s file–presumably the track’s Album folder. Many third-party music players and systems (Sonos, for example) may look for a “folder.jpg” here to use as display artwork.
Very similar to the just updated Save Album Art to Album Folder.
This latest version makes some tweaks for Mavericks compatibility.
More info and download here.
This script will export the artwork of the selected tracks, or the tracks in a selected playlist, as an image file to the folder which contains each selected track’s file—presumably the track’s Album folder—or a specific user-selected folder. If multiple album tracks are selected, the script will make sure only one artwork file per Album is exported.
This latest version fixes the problem with Mavericks and makes some minor maintenance tweaks.
More info and download is here.
Some of the newer Artwork Management scripts will fail in Mavericks. They each use a routine that dumps artwork to a file which doesn’t work very well under OS X 10.9:
tell me to set fileRef to (open for access pathToNewFile with write permission)
tell application id “com.apple.iTunes” to write (get raw data of artwork 1 of theTrack) to fileRef starting at 0
tell me to close access fileRef
iTunes will give up an error like this: “AppleEvents/sandbox: Returning errAEPrivilegeError/-10004 and denying dispatch of event rdwr/writ from process ‘Save Album Art to Album Folder’ because it is not entitled to send an AppleEvent to this process.”
(Two words I didn’t want to see side-by-side: “AppleEvents” and “sandbox”.)
The fix is to just stuff the raw data into a variable first then write the data to the file from the variable. I’ll be working this fix into all the scripts affected over the next days and weeks.
While losing iWorks AppleScript support is anxiety-inducing, some great new features have been added to AppleScript in Mavericks that are pretty exciting. I’ve played a little with libraries and Notifications in the DPs, but haven’t incorporated anything into my scripts since
most a few of these features are not backwards-compatible on earlier operating systems.
Don Southard has a good article at MacStories outlining the latest stuff.