Re: How to access iTunes using cocoa

2010-01-27 Thread Jens Alfke
On Jan 26, 2010, at 11:37 PM, has wrote: > It may be the answer lies somewhere in-between: an explicit network messaging > API with the ability to perform [read-only?] queries, but which mostly uses > safe pointer and one-message-one-object semantics for simplicity, speed and > safety. I agre

Re: How to access iTunes using cocoa

2010-01-27 Thread Paul Sanders
nders" Cc: "Matt Neuburg" ; "Ramesh P" ; Sent: Tuesday, January 26, 2010 7:37 PM Subject: Re: How to access iTunes using cocoa tell app "iTunes" first track whose name is "." and artist is "" end This wil

Re: How to access iTunes using cocoa

2010-01-26 Thread has
Michael Ash wrote: >>> I think a big hit comes from the time it takes to evaluate Apple event >>> object specifiers. [...] >> >> Complex AE object queries have the same benefit that SQL queries do: they >> let the data source perform an efficient search. [...] > > Would this actually matter in r

Re: How to access iTunes using cocoa

2010-01-26 Thread Michael Ash
On Tue, Jan 26, 2010 at 3:57 PM, Jens Alfke wrote: > > On Jan 26, 2010, at 12:45 PM, has wrote: > >> I think a big hit comes from the time it takes to evaluate Apple event >> object specifiers. The cost-benefit tradeoff of having a complex, >> query-driven IPC system is much poorer on OS X, both i

Re: How to access iTunes using cocoa

2010-01-26 Thread Jens Alfke
On Jan 26, 2010, at 12:45 PM, has wrote: I think a big hit comes from the time it takes to evaluate Apple event object specifiers. The cost-benefit tradeoff of having a complex, query-driven IPC system is much poorer on OS X, both in terms of performance and ease of implementation (one of

Re: How to access iTunes using cocoa

2010-01-26 Thread has
Jens Alfke wrote: > On Jan 26, 2010, at 11:13 AM, has wrote: > >> The Apple Event Object Model was optimized for System 7, where IPC >> was extremely expensive > > I know; I was on the AppleEvents engineering team at the time :) > > IPC is still extremely expensive, by the way, although not q

Re: How to access iTunes using cocoa

2010-01-26 Thread Paul Sanders
Tuesday, January 26, 2010 7:37 PM Subject: Re: How to access iTunes using cocoa On Jan 26, 2010, at 11:18 AM, Paul Sanders wrote: > OK, thanks guys. My script is pretty simple-minded: it just > retrieves each track in turn and compares the artist and title > with what I am looking

Re: How to access iTunes using cocoa

2010-01-26 Thread Jens Alfke
On Jan 26, 2010, at 11:18 AM, Paul Sanders wrote: OK, thanks guys. My script is pretty simple-minded: it just retrieves each track in turn and compares the artist and title with what I am looking for. We're way off-topic now, but is there a better way? I'm trying to avoid adding the same tra

Re: How to access iTunes using cocoa

2010-01-26 Thread Jens Alfke
On Jan 26, 2010, at 11:13 AM, has wrote: The Apple Event Object Model was optimized for System 7, where IPC was extremely expensive I know; I was on the AppleEvents engineering team at the time :) IPC is still extremely expensive, by the way, although not quite as much so. The actual OS-l

Re: How to access iTunes using cocoa

2010-01-26 Thread Paul Sanders
ul Sanders. Sorry Jens, meant to post that to the list, not to you privately. - Original Message - From: "Jens Alfke" To: "Matt Neuburg" Cc: "Paul Sanders" ; "Ramesh P" ; Sent: Tuesday, January 26, 2010 6:51 PM Subject: Re: How to access iTunes

Re: How to access iTunes using cocoa

2010-01-26 Thread has
Jens Alfke wrote: > On Jan 26, 2010, at 9:41 AM, Paul Sanders wrote: > >> I use Cocoa's NSAppleScript class. This seems to work fine on Tiger, Leopard >> and Snow Leopard. > > Yup, it just has the limitation that you have to run the script > synchronously, which sucks since many iTunes command

Re: How to access iTunes using cocoa

2010-01-26 Thread Jens Alfke
On Jan 26, 2010, at 10:17 AM, Matt Neuburg wrote: NSAppleScript is your slowest choice because it slows way down as you loop and access memory (such as lists). Scripting Bridge and objc-appscript do all the heavy lifting in Objective-C and just throw Apple events at the target, so they are

Re: How to access iTunes using cocoa

2010-01-26 Thread Otavio
On Tue, Jan 26, 2010 at 7:50 AM, Laurent Cerveau wrote: > You can use the scripting bridge framework which will send AppleEvent in a > nice encapsulated way for you to iTunes +1 Check this doc

Re: How to access iTunes using cocoa

2010-01-26 Thread Jens Alfke
On Jan 26, 2010, at 9:41 AM, Paul Sanders wrote: I use Cocoa's NSAppleScript class. This seems to work fine on Tiger, Leopard and Snow Leopard. Yup, it just has the limitation that you have to run the script synchronously, which sucks since many iTunes commands can take a long time. The

Re: How to access iTunes using cocoa

2010-01-26 Thread Matt Neuburg
On or about 1/26/10 9:41 AM, thus spake "Paul Sanders" : > Should I be scared of the 'false timeout' bug? You should if you're doing the kind of thing that triggers it. Looping in NSAppleScript over many tracks, you're almost certain to hit it. But the same thing is likely to happen even with the

Re: How to access iTunes using cocoa

2010-01-26 Thread Paul Sanders
nice - scanning large libraries in AppleScript is very slow. And check out Doug's AppleScripts for iTunes - there's some interesting stuff in there. Paul Sanders. - Original Message - From: "Matt Neuburg" To: "Ramesh P" Cc: Sent: Tuesday, January 26, 2

Re: How to access iTunes using cocoa

2010-01-26 Thread Matt Neuburg
On Tue, 26 Jan 2010 15:18:38 +0530, Ramesh P said: >Hi, >Is it possible to access iTunes from cocoa application? Is there any open >source framework for accessing iTunes? I use objc-appscript for this. It has some advantages over Apple's Scripting Bridge (for one thing, it's backwards compatible

Re: How to access iTunes using cocoa

2010-01-26 Thread Laurent Cerveau
You can use the scripting bridge framework which will send AppleEvent in a nice encapsulated way for you to iTunes laurent On Jan 26, 2010, at 10:48 AM, Ramesh P wrote: > Hi, > Is it possible to access iTunes from cocoa application? Is there any open > source framework for accessing iTunes? >

How to access iTunes using cocoa

2010-01-26 Thread Ramesh P
Hi, Is it possible to access iTunes from cocoa application? Is there any open source framework for accessing iTunes? Thanks in advance, Ramesh.P ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comm