Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to have iTunes automatically start playing the iTunes DJ playlist when it starts?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

There is usually no nice, clean, built-in way to hook into (or be notified of) a particular application's launch. But it is easy to combine launching iTunes and starting a playlist in an AppleScript program:

tell application "iTunes"
    play playlist "iTunes DJ"
end tell

iTunes will automatically launch if it was not already running, then it will start playing the playlist.

Paste the code into an empty AppleScript Editor (Script Editor prior to 10.6) document.

  • To use it from a AppleScript-capable launcher (the built-in script menu, Quicksilver, FastScripts, LaunchBar, etc.), save it as a “script” somewhere (usually) under ~/Library/Scripts (your launcher may have a preferred location).

    You might even be able to find a launcher or utility that can automatically run this AppleScript program every time iTunes is launched (I have never used it, but maybe Linked Applications Launcher could do this).

  • To use it from Finder, the dock, or an application-only launcher, save it as an “Application” (“application bundle” prior to 10.6) and put it wherever you find it convenient. To start the playlist just launch the saved ‘applet’ like a normal application (click in the dock, double-click in Finder, etc.).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.