I’m working on an app where I want to signal iTunes at certain times to play single tracks from whatever playlist happens to be active. I’ve just started studying Scripting Bridge, I’ve used the command-line tools Apple references to create an “iTunes.h” file, and I’ve got this and ScriptingBridge.framework in my project. Now I thought all I would have to do is
iTunesApplication *iTunes = [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"];
and when I want to cue whatever track is up next:
[iTunes playOnce:YES];
iTunes does respond, but if I understand Apple’s sample code, the YES parameter should compel it to play one and only one track. In fact, it doesn’t seem to matter whether it’s YES or NO: iTunes always plays from the selected track to the end of the playlist, however many tracks that may be. Am I missing something? And since I need to send only one very simple Apple Event, is there a simpler way to do this than going through the whole Scripting Bridge framework?