Followup... I tried two workarounds, both however return an incorrect result:
// Try #1 iTunesPlaylist *currentPlaylist = [ iTunes currentPlaylist ] ; SBElementArray *currentTracks = [currentPlaylist tracks]; int index = [currentTracks indexOfObject:[iTunes currentTrack] + 1]; NSLog(@"%d", index) // Returns 376275776! Should be 1... // Try #2 NSAppleScript *the_script=[[NSAppleScript alloc] initWithSource:@"tell application \"iTunes\" to return index of current track"]; int index = (int)[the_script executeAndReturnError:nil]; [the_script release]; NSLog(@"%d", index); // Also returns 376275776 :-/ Surely there has to be an easy way to do this? On Mon, Mar 10, 2008 at 12:56 PM, <[EMAIL PROTECTED]> wrote: > Anyone know how to get the index of the current iTunes track using > Scripting Bridge? With Applescript, it's as simple as "tell iTunes to > return index of current track", but iTunes SB has no such property > (well, there is one, but it only refers to the index of the current > playlist). It seems the iTunesTrack index property is simply > missing...? Or am I missing something? > _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
