One of the most hackable applications on a Mac computer is probably iTunes. This program is no longer just a music jukebox, it’s a multimedia player that includes not only song and movie files, but Apple mobile apps, PDFs, audio books and e-books, and several powerful file management features such as smart folders.
If all of this is not too overwhelming for you, you can add even more functionality to the program using what is called an AppleScript, a cool scripting language that can automate programs on your Mac.
Now if you’re thinking, “I don’t have the time or the inclination to learn a scripting language”, well, don’t worry, Doug’s AppleScripts for iTunes contains over 400 ready-made iTunes AppleScripts that can be downloaded for free. In addition, with the ability to easily add keyboard shortcuts to any program on your Mac, you will see that using iTunes AppleScripts can be even more powerful.
So if you have a little time, let’s explore iTunes AppleScripts. This tutorial will show you how to build a really cool AppleScript script that will play a specified playlist using a keyboard shortcut.
My Favorite Playlist Script
With this AppleScript script, you can use a keyboard shortcut to play a specified playlist without having to navigate to the playlist itself and click on it.
- Start off by opening the AppleScript editor, found in your Applications folder of your Mac.
- Don’t worry if you don’t understand this program. You can learn more about it later. For now, just copy and paste the following script in the editing window.
tell application "iTunes" tell (some track of playlist "Favorite Jazz") to play end tell
- Now, you will want to replace the “Favorite Jazz” playlist with the exact name of a playlist that you want to activate. The selection can be a regular playlist or a smart playlist. Type, or copy and paste, the name of your selected playlist and be sure to put it quotation marks. (Note: I enlarged the type in this screenshot for better viewing. Your type will probably look much smaller).
- Now hit the Run button in the menu bar and see if your selected list plays. If it runs, then save the script in a special iTunes Script that either already exists on your computer or one that you can quickly create. You will want to save it in your Home Library>iTunes>Scripts. Use the same title for the playlist as the name for the script. If the Scripts folder doesn’t already exist, create one and add this script to it. This folder can also be used to add other iTunes scripts to.
- Now switch over to iTunes and click on the AppleScripts icon in the iTunes menu bar. It is there that you will find the script you just saved.
Create Keyboard Shortcut
Notice above that I have a keyboard shortcut assigned to my script. Here’s how you add that. Open Preferences and then click on Keyboard under Hardware. ï»¿
- Select the Keyboard Shortcuts button, and then select Application Shortcuts on the bottom left side.
- See if there are any existing keyboard shortcuts for your iTunes application. If not, click the + button and select iTunes.app as the application, and then simply type in the exact name of the script you just saved in step 4 above.
- Where it says Keyboard Shortcut, type in the keyboard shortcut that you want to use.
Now you’re set. When you navigate to iTunes and type your keyboard shortcut, your specified playlist will play.
You can also use an application launcher like Quicksilver, Alfred, or Butler to activate iTunes scripts from within any application.
Let us know if this tutorial works out for you (or not). If you want to add more iTunes AppleScripts, check out Doug’s AppleScript site. Also check out this article for other ways to improve your iTunes experience.