Feb 23, '05 07:44:00AM • Contributed by: cudaboy_71
I found that by using the OS's idle handler, one can effectivley tell iTunes to "play the next track" from a list -- as long as it's before the currently-playing sample has finished. The script itself is stupid easy, but there is a catch to making it work, so keep your eyes peeled.
First, open Applications: AppleScript: Script Editor, and paste the following into it:
on idle
tell application "iTunes"
next track
end tell
return 29
end idle
I'm not a programmer, so feel free to correct my assertion here: Using the idle handler in this manner allows the AppleScript to release hold of its CPU cycles until the command is explicitly called (every 29 seconds in this case, so as not to let the sample reach its end). So, it's not like having this script running constantly adversely affects system performance.
Here's the catch to make this work: The script must be saved as a 'Stay Open' application. When saving the script, choose Application as the file format, and make sure the Stay Open box is checked.
With the script in place, here's the drill:
- Perform a search in the iTMS that returns a list of music you'd like to listen to. For example, I searched 'Rolling Stones,' and had 75 songs returned.
- Start playing the first track
- Before that track finishes its 30 second sample, launch the script.
