Re: Problems with ScriptingBridge and iTunes

2008-03-03 Thread has
On 3 Mar 2008, at 15:27, Steven Degutis wrote: Thank you for the update on that sample code. I was hoping it would continue to be ignored because I was publicly berated in the #macdev channel for posting it, but oh well. Don't feel too bad: if you're coming from a Cocoa background, applicati

Re: Problems with ScriptingBridge and iTunes

2008-03-03 Thread Christopher Nebel
On Mar 1, 2008, at 5:28 PM, Hannes Petri wrote: I want to retrieve the path to the currently played file in iTunes. I thought scripting bridge would be the perfect tool for this, however i've run into some problem. I have this code: iTunesApplication *iTunes = [[SBApplication alloc] initW

Re: Problems with ScriptingBridge and iTunes

2008-03-03 Thread Steven Degutis
Thank you for the update on that sample code. I was hoping it would continue to be ignored because I was publicly berated in the #macdev channel for posting it, but oh well. Thanks to Wolf's post up there, I'm not going to continue to learn SB any longer, and I just hope Apple fixes it up. On Mon,

Re: Problems with ScriptingBridge and iTunes

2008-03-03 Thread has
Jens Alfke wrote: Moreover, since Obj-C is a dynamic language, it's more important what the class of the object is at runtime, than what type the pointers are defined as at compile time. You can change the type declarations, but it won't affect what actual objects you get back at runtime. Thi

Re: Problems with ScriptingBridge and iTunes

2008-03-02 Thread Jens Alfke
On 2 Mar '08, at 4:54 AM, Steven Degutis wrote: I think it's clear why [currentTrack isKindOfClass:[iTunesFileTrack class]] evaluates to true: in the previous line, you defined it as such, like this: iTunesTrack *currentTrack = [iTunes currentTrack]; So obviously it is an iTunesTrack! No. It

Re: Problems with ScriptingBridge and iTunes

2008-03-02 Thread has
Adam P Jenkins wrote: I'm not sure what the logic is behind the "get" method, but there it is. It's completely logical if you appreciate that Apple event IPC is RPC +queries. To tell a scriptable application to perform an operation, you send it a command (Apple event). If the command oper

Re: Problems with ScriptingBridge and iTunes

2008-03-02 Thread Adam P Jenkins
On Mar 2, 2008, at 6:16 PM, Adam P Jenkins wrote: Just call the "get" method on the track object that currentTrack returns to get the iTunesFileTrack object. I.e. this works iTunesFileTrack *currentTrack = [[iTunes currentTrack] get]; NSLog("location is %@", currentTrack.location); The docu

Re: Problems with ScriptingBridge and iTunes

2008-03-02 Thread Adam P Jenkins
Just call the "get" method on the track object that currentTrack returns to get the iTunesFileTrack object. I.e. this works iTunesFileTrack *currentTrack = [[iTunes currentTrack] get]; NSLog("location is %@", currentTrack.location); The documentation for the "get" method from the SBObject.h h

Re: Problems with ScriptingBridge and iTunes

2008-03-02 Thread has
Jonathan 'Wolf' Rentzsch wrote: On Mar 1, 2008, at 7:28 PM, Hannes Petri wrote: iTunesApplication *iTunes = [[SBApplication alloc] initWithBundleIdentifier:@"com.apple.iTunes"]; iTunesTrack *currentTrack = [iTunes currentTrack]; if ([currentTrack isKindOfClass:[iTunesFileTrack class]]) { … }

Re: Problems with ScriptingBridge and iTunes

2008-03-02 Thread Steven Degutis
Hannes, I haven't heard of this ITApplication before, but for your specific problem, I think it's clear why [currentTrack isKindOfClass:[iTunesFileTrack class]] evaluates to true: in the previous line, you defined it as such, like this: iTunesTrack *currentTrack = [iTunes currentTrack]; So obvio

Re: Problems with ScriptingBridge and iTunes

2008-03-02 Thread has
Hannes Petri wrote: I want to retrieve the path to the currently played file in iTunes. I thought scripting bridge would be the perfect tool for this, however i've run into some problem. I have this code: iTunesApplication *iTunes = [[SBApplication alloc] initWithBundleIdentifier:@"com.apple.iT

Re: Problems with ScriptingBridge and iTunes

2008-03-01 Thread Jonathan 'Wolf' Rentzsch
On Mar 1, 2008, at 7:28 PM, Hannes Petri wrote: iTunesApplication *iTunes = [[SBApplication alloc] initWithBundleIdentifier:@"com.apple.iTunes"]; iTunesTrack *currentTrack = [iTunes currentTrack]; if ([currentTrack isKindOfClass:[iTunesFileTrack class]]) { … } The problem is,