dougscripts.com

Welcome!

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

Popular Now

File Renamer

downloaded 3m 56s ago

File Renamer v3.8

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

Search-Replace Tag Text

downloaded 33m 50s ago

Search-Replace Tag Text v5.5

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

Remove n Characters From Front or Back

downloaded 34m 6s ago

Remove n Characters From Front or Back v5.10

Delete characters from the beginning or ending of selected tracks' name, artist, album, comments, composer, or show tags

downloaded 52m 4s ago

Move Playlists to Folder v2.3

Move selected playlists to a new or existing folder

Super Remove Dead Tracks

downloaded 55m 13s ago

Super Remove Dead Tracks v4.10

Remove iTunes tracks disassociated from files

Tracks Without Embedded Artwork

downloaded 1h 2m 23s ago

Tracks Without Embedded Artwork v1.8

Gather audio tracks whose files contain no artwork metadata

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 a Download/Installation FAQ & Video.

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

Latest:

April 21 2019 - 2:59 pm

Shortcuts and AppleScript on the Mac

Dr. Drang has posted some thoughts and questions about the future of automation on the Mac.

April 16 2019 - 12:44 pm

M3Unify v1.12.1

I just posted an update to M3Unify. Just a couple of minor fixes but if you’re registered its always good to have the latest version.

M3Unify is a flexible file exporter and M3U playlist creator that will allow you to sensibly off-load copies of your iTunes songs to a user-chosen location—separate folder, external drive, USB thumb drive, SD card and so on—the way you and your portable or car audio player want.

Download the free trial from this page and then purchase a registration for $5.00.

And many thanks to M3Unify’s current users!

April 8 2019 - 8:15 am

Metadata Not Sticking to MP3s? Might Be AirPlay and AppleTV

Over the past few months, probably since the release of Mojave and iTunes 12.9, I’ve occasionally received queries from Correspondents concerning a problem with changing the tags of MP3 tracks. The changes wouldn’t be written to the MP3 files’ metadata or would revert back to what they had been before the change. It affects MP3s only, not M4As.

I was not seeing this myself nor was I able to replicate it, but, as I say, I was asked if I knew about it a few times.

This post at Apple Support Communities appears to have discovered a factor involved: AirPlaying to AppleTV. When AirPlay to AppleTV is turned off tags would be written correctly to the associated MP3 files.

I’m wondering if this could be related to another MP3 issue I have heard about recently. And this is weird. Whenever a script of mine is used that applies artwork data to an MP3, the file is mangled in such a way that the last several seconds of audio is copied and added to the end of the audio file (I said it was weird). I could not replicate this either.

March 25 2019 - 7:30 pm

iTunes 12.9.4.94

Apple has updated macOS to 10.14.4. When you update you’ll get an update to iTunes, version 12.9.4.94.

The previous version was 12.9.2.5.

I don’t know exactly what’s changed, probably mostly under-the-hood stuff.

February 13 2019 - 10:46 am

UPDATED: Copy Rating Stars to Other Tag v1.1

The name of this script sort of looks like a word salad, now that I’ve enetered it as the title for this post. Oh well, it makes perfect sense.

A track’s rating property is actually a number value between 0 and 100. iTunes creates the rating stars in its interface by converting this value into graphical stars and half-stars: v div 20 = number of stars and if (v mod 20 = 10) then add half-star.

To the vexation of some iTunes users, a track’s rating value does not get written to its corresponding file’s metadata. So if you’re depending on a rating tag showing up in some other app in which you use your audio files (such as some DJs are) you have to figure out some other way of getting your iTunes track ratings to “travel” with your audio files.

An easy solution is to convert the rating value to Unicode text stars and dump it to some non-essential or lesser-used text tag—one that does get written to metadata by iTunes. And that’s what Copy Rating Stars to Other Tag does:

After running the script against a few tracks, copying the stars to the Composer tag, the metadata for the file should look something like this (as seen via Show Me The Metadata):

…and when the file is added or refreshed in another app, the text stars will display in that track’s Composer field.

Presumably, DJs don’t much care about Composer, Grouping and so on (title and artist, of course, and perhaps year and genre), so these tags may be available to accommodate ratings.

In fact, it was DJ’ing Correspondent who asked that I include Composer as an option in the initial version of Copy Rating Stars to Other Tag, and thus, this update.

January 24 2019 - 3:45 pm

Apple Provides iTunes v12.8.2

Apple has released iTunes 12.8.2, an update for users who have not updated to Mojave (macOS 10.14).

If you don’t see it in the App Store app, here is a link to a stand-alone version.

It apparently fixes some issues with AirPlay and, of course, makes the obligatory performance enhancements, and so on.

December 30 2018 - 12:20 pm

Have a Happy New Year

repeat

if (get current date) > date ("January 1, 2019") then

exit repeat

else

delay 10

end if

end repeat

tell application "iTunes"

play (some track whose name is "Auld Lang Syne")

end tell

December 28 2018 - 10:33 am

Updated Mono-Stereo Toggling

Apple changed a few things in System Preferences under Mojave which broke this script to toggle between Mono and Stereo output.

Here is the fix. You will note that it is a simple change to the line targeting the System Preferences’ Accessibility window.

tell application "System Preferences"

reveal anchor "Hearing" of pane id "com.apple.preference.universalaccess"

end tell

tell application "System Events"

tell application process "System Preferences"

set frontmost to true

tell group 1 of window "Accessibility"

# pre-Mojave – replace the line above with the one below

# tell window "Accessibility"

set monoStereoCheckbox to checkbox "Play stereo audio as mono"

if (get value of monoStereoCheckbox) as boolean is true then

set ddMessage to "Switch to STEREO output?"

else

set ddMessage to "Switch to MONO output?"

end if

if button returned of (display dialog ddMessage buttons {"No", "Yes"} default button 2) is "Yes" then

tell monoStereoCheckbox to click

end if

end tell

end tell

end tell

if application "System Preferences" is running then

tell application "System Preferences" to quit

end if

For more details, read the original post.

December 19 2018 - 8:30 am

Dupin Lite 2 v1.4.0 Now at Mac App Store

Dupin Lite 2 has been updated to version 1.4.0 and is now available on the Mac App Store.

Dupin Lite 2 is a “lighter” version of my iTunes duplicates-managing app Dupin. It has fewer power-user features and essentially gets right to the business: find dupes, filter for Keepers, Purge.

This latest version accommodates Dark Mode under Mojave and adds some performance enhancements.

December 10 2018 - 2:57 pm

Idle Wish List

Dear iTunes Santa,

It would be great if clearing Up Next could be done via AppleScript.

Also, I have wanted to

tell application "iTunes"

make new playlist window with properties {view:playlist "Mom’s Favorites"}

end tell

for a long time.

I have been a good boy.

Site contents © 2001 - 2019 (that's right: 2001) Doug Adams and weblished by Doug Adams. Contact support AT dougscripts DOT com. About.
All rights reserved. Privacy.
AppleScript, iTunes, iPod, iPad, and iPhone are registered trademarks of Apple Inc. This site has no direct affiliation with Apple, Inc.
The one who says "it cannot be done" should not interrupt the one doing it.