tell application "iTunes"
if player state is playing then
stop
else
set the view of the front browser window to playlist "kertun musaa"
set myNumberOfTracks to number of tracks in playlist "kertun musaa"
set randomTrack to (random number (myNumberOfTracks - 1)) + 1
play track randomTrack of user playlist "kertun musaa"
end if
end tell
So when the tag is shown to the reader the script either
- stops the playback if itunes is playing a something, or
- if nothing is playing, starts a play a random song in a named playlist
Using applescript one can do almost anything on iTunes. A good source for further information is http://dougscripts.com/itunes/
1 comment:
Awesome post! You helped me solve my prob...thx!!
Post a Comment