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: richorlin on Mar 19, '07 10:48:02AM

You can combine sampling a track, rating it and continuing play or revert to original track with this script:

tell application "iTunes"
set answer1 to "Revert"
set answer2 to "Let This Play"
set answer3 to "Play This From Beginning"
set playerOffset to 10 --seconds

set currentTrack to current track
set playPosition to player position
set theSampleTrack to selection

play selection
set player position to playerOffset
set R to (rating of current track) / 20 as integer
set theRating to (choose from list {0, 1, 2, 3, 4, 5} with prompt "Please set your rating then click OK" default items R without multiple selections allowed) as integer
set theSampleTrack to current track
if theRating is not false then set the rating of theSampleTrack to theRating * 20
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 | # ]