Hello,
I'm trying since one month to create an application that detects the current track of iTunes to tag the song and calculate the bpm (through a taping button)
When the user modifies one of the field of the tag, the track is locked in the application : that means : if iTunes currentTrack changes, my application stay on the previous track.
My problem : I've got the persistent ID of the previous track. I created an applescript to get the track corresponding to this persistent ID. But I don't find how to get this track in cocoa part of the application !!!!
here the script :
on open param
tell application "iTunes"
set trackItems to (every track of playlist "Library" whose persistent ID is param)
repeat with aTrack in trackItems
return aTrack
end repeat
return null
end tell
end open
On cocoa side,
NSAppleEventDescriptor *desc = [findTrackWithPersistentIDScript runWithParameters: [NSArray arrayWithObjects: lockPersistentID ,nil]];
what can i do with the NSAppleEventDescriptor ? I would like to have a iTunesTrack or iTunesFileTrack . I verify with a display dialog that the track is well found
Thanks for reading and for your help !
PS : when i debug, if i do [ desc data ] , i have a NSContreteData and below an iTunesItem. But I don't know how to get this iTunesItem (i tried a cast...) and i managed to get it, what can i do with it to have an iTunesTrack .