property the_title : "Gouge Away" property the_artist : "Pixies" property the_playlist : "Library" property start_here : 23 -- set to 0 to begin at the beginning property stop_after : 0 -- set to 0 to disable tell application "iTunes" set the matches to (every track of playlist the_playlist whose name is the_title) as list if the (count of matches) > 0 then if the (count of matches) = 1 then set the_track to item 1 of matches else repeat with t from 1 to the (count of matches) if the artist of item t of matches is the_artist then set the_track to item t of matches exit repeat end if end repeat end if play the_track set player position to start_here if stop_after > 0 then delay stop_after + 1 pause end if else display dialog "No song matches. Please confirm details." buttons {"Yikes!"} default button 1 end if end tell