Welcome!

Download hundreds (456 and counting) of AppleScripts for Apple's iTunes that will help make managing your digital music collection easier and more fun!

Popular Now

Search-Replace Tag Text

Search-Replace Tag Text v4.1

Perform search-and-replace on text in your choice of tags

Convert and Export v2.1

Convert selected tracks and export the converted files to a new folder

Super Remove Dead Tracks

Super Remove Dead Tracks v4.2

Remove iTunes tracks disassociated from files

Enter Description Text for Selected

Enter Description Text for Selected v2.0

Enter text for the selected tracks' Description tag

List MIAs

List MIAs v4.0

Display, create text file listing info of dead tracks

File Renamer

File Renamer v3.0

Use tag data to formulate new file name for selected tracks' files

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 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:

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 & Video.

Check back often or subscribe to my Twitter feed @dougscripts, my RSS blog feed and 30 Most Recent Scripts RSS to stay notified about new and updated scripts and info.

Latest:

November 26 2014 - 12:11 pm

NEW: Tracks Without Embedded Artwork

MP3, AAC and ALAC audio files have the capability to store artwork as image data as metadata internally. In this way, artwork can “travel” with the file. But it’s not always easy to tell if an audio file actually contains this metadata. For example, even though a track entry may have assigned artwork (which you can see in iTunes), its corresponding file may not include that artwork as metadata.

Tracks Without Embedded Artwork will examine the files of the selected iTunes tracks (or tracks in the selected playlist) for artwork metadata. Eligible audio tracks whose files do not contain artwork metadata will be copied to a new discrete playlist.

Once these tracks have been corraled, you can use other applets to embed their artwork to their files.

Tracks Without Embedded Artwork is free to try full-featured for ten days, $1.99 to purchase. More information and download is here.

November 24 2014 - 11:26 am

UPDATED: Re-Apply Downsized Artwork v3.0

Re-Apply Downsized Artwork v3.0 will examine the first artwork of each selected iTunes track (or tracks in the selected playlist) and if greater than a user-set resolution (n x n pixels) will downscale the image to that resolution. Artwork already at the set resolution or smaller will not be affected.

This latest version has substantial UI and feature additions: cycle through each selected track; displays track and artwork information; preview the artwork at the selected resolution; pad the image to make square; can insert as track’s first artwork to preserve current artwork(s) instead of replacing the first artwork; apply settings to all selected tracks or just the current displayed track; view image at actual pixel dimensions or proportionally sized to the re-sized window; export the displayed image as a file.

Re-Apply Downsized Artwork is $1.99 and free to try full-featured for ten days. OS X 10.8 or later only. More information and download is here.

November 14 2014 - 8:42 pm

Son of Latest Batch of Updates

Like last week, I hadn’t gotten around to posting individual blurbs on all the updated stuff from this week (November 9-14). So, briefly:

Drop to Add and Give Info v3.0 – drop files onto this droplet and it will supply a Get Info-type interface to add basic tags to the tracks once they’re added to iTunes. Better Yosemite support.

PDF Adder v5.0 – applet/droplet and PDF Service enable you to supply some basic tags to PDFs added to iTunes, the latter is a PDF Service workflow accessible from any app’s Print Dialog. Yosemite support, minor tweaks.

Make PDF Booklet v3.0 – assists with creating lists of track data exported as a text-only PDF. Support for Yosemite.

This Tag That Tag v4.2 – copy, swap and append data between tags of selected tracks. Fixed a progress indicator that wouldn’t indicate progress. I hate when that happens.

Delete Selected Files v2.1 – removes selected tracks and can move their files to the Trash or delete them immediately. Fixes a problem when canceling and progress would not cancel.

Drop to Add and Make Playlists v3.0- drop folders of media files onto this droplet and it will add the files to iTunes and create playlists for the tracks based on the names of the folders. Adds better support for Yosemite.

All HD and SD to Playlists v2.0 – creates two playlists containing, respectively, all the SD video tracks and all the HD video tracks in the library. Mostly just a maintenance update since last update in 2009.

Make An EQ Preset Script v3.0 – creates a new AppleScript applet using data from the selected EQ Preset. When that applet is launched it will re-create the EQ Preset in any iTunes (on a Mac). Handy way to archive EQ Presets. This is a major maintenance update, added better options in the applet for renaming.

Subscribe to the 30 Most Recent Scripts RSS or my Twitter feed @dougscripts to stay updated on script releases.

November 14 2014 - 10:31 am

M3Unify v1.1.1

The latest version of M3Unify v1.1.1 fixes a few bugs working with protected files and a couple of other minor issues.

M3Unify is a flexible M3U playlist creator and file exporter that will allow you to load a USB thumb drive or SD card with copies of your iTunes songs the way you and your audio player want. It can archive M3U playlists and audio files to a folder, volume or portable media and includes options to create Artist/Album sub-folders, rename files, convert to AAC, and more.

November 9 2014 - 2:51 pm

UPDATED: PDF Adder v5.0

PDF Adder is a collection of two AppleScripts that each assist with adding PDF files to iTunes as “digital booklet” PDF tracks. Each provides an interface for easily supplying Author (artist), Album, Category (genre), Year, Rating and Description tag data which is then applied to the newly-added PDF track entry in iTunes:

  • Add as PDF to iTunes is a PDF Service workflow that, when installed, will be available in the PDF pop-up menu of the Print Dialog. It allows you to save the current document as a PDF file (from any application that uses the Print Dialog) and add it to iTunes. I describe here how I use it with Safari Reader.
  • PDF Adder is an applet/droplet that will let you choose or drag-and-drop an existing PDF file and add it to iTunes. It can be installed in iTunes’ Scripts folder for easy access from iTunes Script menu.

Anything you can print from the Print Dialog, you can make into a PDF. And any PDF can be added to iTunes.

The latest version of each script is compatible with Yosemite and has a few minor tweaks for better performance.

More information and download is here.

November 8 2014 - 2:42 pm

Latest Batch of Updates

So busy slapping ‘em together that I hadn’t posted I’d updated ‘em. Here’s the last few updated scripts (October 29 – November 8):

Set Video Kind of Selected v5.0 – change the video kind property of the selected tracks to your choice of “Home Video”, “Movie”, “Music Video” or “TV Show”. Additionally, “Show Name”, “Season Number”, and incremental “Episode Number” can also be set or cleared for each selected track.

Convert and Replace v2.0 – convert the selected tracks using an encoder chosen on-the-fly (the encoder’s current Preferences-set options will be in effect) and replace the originals throughout the playlists of your entire library with the newly converted versions. Additionally, you can opt to Trash/delete or keep the original files and tracks.

Trackographer v4.0 – stay-open applet will monitor iTunes and send tag and time-of-play information of each track that plays (including iTunes Radio and internet radio streams if they provide track info) to a text file. Preferences can be set to include or not include various basic tags and to create a plain text file or a tab-delimited text file which can be imported into a spreadsheet.

Multi-Item Edit v2.1 – mostly bug fixes; edit most track tags (and some additional options) in a single window which emulates the pre-iTunes 12 “multiple items” format; that is, a checkbox adjacent to each tag allows you to select which changes are to be applied to the selection’s tags.

Delete Selected Files v2.0 – remove each selected track from all playlists and Trash or immediately delete their corresponding files. Some iTunes delete commands will not move files from outside the “iTunes Media” folder to the Trash. This script worksaround that.

Find Truncated Tracks v2.0 – assists with segregating iTunes Match tracks that appear to get cut-off when played (due to a possible bug which Kirk describes here). Then these truncated tracks can be deleted and re-downloaded intact (by you, not the script).

Playlist Manager v2.0 – iTunes only allows one playlist to be selected at a time. This applet can perform common useful tasks on a multiple selection of playlists: rename (add text, remove text, search and replace text), duplicate, delete, export, merge.

Search Results to Playlist v2.0 – search a chosen category (Library, Music, Movies, etc) or the selected playlist for user-entered text by All, Song, Artist, Album, or Composer tag and copy the track results to a Search Results playlist, which will be created automatically if necessary. Can optionally re-create or append to the Search Results playlist on each run. Floats over iTunes while active for easy access.

October 31 2014 - 3:06 pm

Save Current Track’s Artwork

I don’t know why you’d want to do this on any kind of regular basis, but I thought it was kinda fun for a Friday afternoon. I wanted to see if I could save artwork from iTunes Radio tracks, but it works with whatever the current track is:

tell application “iTunes”

try

if player state is not stopped then

set alb to (get album of current track)

tell artwork 1 of current track

if format is JPEG picture then

set imgFormat to “.jpg”

else

set imgFormat to “.png”

end if

end tell

set rawData to (get raw data of artwork 1 of current track)

else

return

end if

on error

display dialog “Problem getting track info.” buttons {”OK”}

return

end try

end tell

try

set baseLoc to choose folder

on error

return

end try

set newPath to ((baseLoc as text) & alb & imgFormat) as text

try

tell me to set fileRef to (open for access newPath with write permission)

write rawData to fileRef starting at 0

tell me to close access fileRef

on error m number n

log n

log m

try

tell me to close access fileRef

end try

end try

Open that in Script Editor and “Save…” it as “Save Current Track’s Artwork” (or whatever) in your ~/Library/iTunes/Scripts/ folder. Whenever a track is playing, you can launch it to choose a folder in which to save the current track’s artwork. Great way to fill up your desktop with effluvia. (I’m kidding. But it would be good for that.)

October 27 2014 - 7:38 pm

iTunes 12 Bug? Selecting Audiobook Tracks Fails

Scripts and apps that use a selection of audiobook tracks from the Audiobooks library (notably Join Together, but others as well) will fail due to an apparent bug in iTunes 12. What appears to happen is that the selection object is always empty when Audiobooks library tracks are selected. Selecting audiobook tracks and then running a script as simple as this:

tell application “iTunes”

set theSelection to selection

end tell

…will always return an empty list, rather than a list of track references.

This will cause any script or app which expects a selection of Audiobooks library tracks to presume that no tracks are selected. It also affects such tracks that are dragged.

It doesn’t appear to affect tracks outside the Audiobooks library, such as MP3 voice recordings, or CD books ripped as AAC, and so on.

Thus, changing an Audiobooks library track’s media kind in its Get Info window to “Music” will avoid the issue; this will, of course, move the track out of the Audiobooks library to the Music library.

[UPDATE: A Correspondent suggests placing audiobook tracks in a separate playlist outside the Audiobooks library playlist. I can confirm that this works as well (and is likely a better workaround than changing the audio kind.)

Additionally, I have also found that a script cannot get a reference to the Audiobooks library playlist either. A "view of front window" when Audiobooks is selected returns a "unknown object type" error. This seems to indicate a problem with just the Audiobooks library and not audiobook tracks generally. Strangely, however, this works to get a ref to the Audiobooks library playlist: "set thePlaylist to (get some playlist whose special kind is Books)"]

I’ve filed a bug report.

October 27 2014 - 10:08 am

UPDATED: Multi-Item Edit v2.0

Gee, from v1.0 to v2.0 in less than a week.

I am extremely happy with the feedback on Multi-Item Edit. So I wanted to get a new version going with more tags as soon as I could manage it.

Multi-Item Edit v2.0 lets you modify the tags of a multiple selection of tracks in a single window—you can see everything without having to dart between tabs.

Version 2.0 adds Artwork, Name, Sort Name, Album Rating, Plays, Skips, Played, Last Played Date, Last Skipped Date, Lyrics and Category tags; sorting tags have been moved to a togglable side drawer. I also added “Checkmark All” and “Checkmark None” commands as a convenience. You probably wouldn’t want to apply all checkmarked tags, but you may want a majority of them (or a minority of them) and clicking on checkboxes all afternoon is no way to go through life, son.

This is a free update for registered users. Multi-Item Edit is $1.99 with a ten day full-featured trial period.

October 25 2014 - 7:51 pm

My Two iTunes 12 Bugaboos

I don’t like to complain, but:

1) When you select a CD in iTunes 12, the keyboard shortcut Command-I no longer shows the CD’s Get Info panel. The “Get Info” button does work as expected.

2) Likewise, while a CD is selected, the View menu’s “View Options…” and Command-J shortcut do not work. The menu flashes, which is quaint. But you can only show/hide the columns of a CD playlist by right-clicking the column headers.

3) (Did I say two?) Speaking of Showing columns: you can only show/hide one column at a time by using the “Show Columns” popup in the “View Options” panel. Try turning fifteen or so columns off or on and see how you feel afterwards.

Site contents © 2001 - 2014 Doug Adams and weblished by Doug Adams, dougscripts AT mac DOT com. About.
All rights reserved. Legal.
AppleScript, iTunes, iPod, iPad, and iPhone are registered trademarks of Apple Inc.