• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problems with ScriptingBridge and iTunes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with ScriptingBridge and iTunes


  • Subject: Problems with ScriptingBridge and iTunes
  • From: Hannes Petri <email@hidden>
  • Date: Sun, 2 Mar 2008 02:28:03 +0100

Hello!

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.iTunes"];
iTunesTrack *currentTrack = [iTunes currentTrack];

if ([currentTrack isKindOfClass:[iTunesFileTrack class]]) {
…
}


The problem is, that the class of the object returned is _always_ iTunesTrack, and not iTunesFileTrack, as i expect it to be. If i run the following applescript code:

tell application "iTunes" to current track

I get a "file track", which makes it possible to fetch the path using the "location" attribute. If I, in the ObjC example, try [currentTrack location], I'm told that it doesn't respond to that selector.
I have made certain that the object is of class iTunesTrack by typing 'po [currentTrack class]' in gdb.


Very thankful for help!


Hannes Petri_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Problems with ScriptingBridge and iTunes
      • From: Christopher Nebel <email@hidden>
    • Re: Problems with ScriptingBridge and iTunes
      • From: Adam P Jenkins <email@hidden>
    • Re: Problems with ScriptingBridge and iTunes
      • From: Jonathan 'Wolf' Rentzsch <email@hidden>
  • Prev by Date: NSMachPort thread safety
  • Next by Date: Re: NSMachPort thread safety
  • Previous by thread: Re: NSMachPort thread safety
  • Next by thread: Re: Problems with ScriptingBridge and iTunes
  • Index(es):
    • Date
    • Thread