Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Temporarily play an excerpt of an iTunes song' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Temporarily play an excerpt of an iTunes song
Authored by: TheCrunge on Mar 16, '07 09:58:20AM
I like this hint. I added a little more functionality. This allows you to revert (as the original script does), continue to play the selected track, or play the selected track from the beginning. In case you sample the tune and would like to let it play on, or would like to hear it from the beginning:
tell application "iTunes"
	set answer1 to "Revert"
	set answer2 to "Let This Play"
	set answer3 to "Play This From Beginning"
	set playerOffset to 50 --seconds
	
	set currentTrack to current track
	set playPosition to player position
	set theSampleTrack to selection
	
	play selection
	set player position to playerOffset
	
	set theChoice to (display dialog "Sampling Track..." buttons {answer2, answer3, answer1} default button 3)
	if button returned of theChoice is answer1 then
		play currentTrack
		set player position to playPosition
	else if button returned of theChoice is answer2 then
		return
	else if button returned of theChoice is answer3 then
		set player position to 0
	end if
end tell


[ Reply to This | # ]