Just Play This Track and Stop Redux
For years many iTunes users and Correspondents have asked about a script that can just play the selected track and stop. Various methods using timers and delays and idle handlers were thrown at the challenge but nothing worked perfectly. But then: the iTunes Team quietly added a once parameter to the iTunes play command.
tell app "iTunes" to play item 1 of selection with once
Run that on a selected track and iTunes will play it once and then stop.
You know when they added it?
In iTunes 6!
Incredulous, I went back to my original write-up on iTunes 6 from October 2005. Whack! It was the only AppleScript change I even mentioned...and then promptly forgot about. I even managed at the time to write a Missing Menu Script using it.
In any case, all of this was precipitated by a posting at Mac OS X Hints awhile back, authored by fellow AppleScripter Laine Lee, which mentions the once parameter and just-play-once-and-stop trick.
I can't believe it took five years for me to rediscover it.