Adam's Blog

Applescript + iTunes = Simple Functionality Added

Sunday April 10, 2011
Category: Uncategorized

I like listening to music. I prefer when the song finishes. I don't want to stay hovering over iTunes for the end of the song. There isn't a button to do this but we do have Applescript. Here is the hard way to do it.

tell application "iTunes"
    if player state is playing then
        if selection is not current track then
            reveal current track -- reveal selects current track...
        end if
        play selection with once
    end if
end tell

Thanks to Doug's Applescript for iTunes reference for the reveal command.

←   newer :: older   →