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 track
to the library twice. Thanks.

Paul Sanders.

Sorry Jens, meant to post that to the list, not to you 
privately.

----- Original Message ----- 
From: "Jens Alfke" <j...@mooseyard.com>
To: "Matt Neuburg" <m...@tidbits.com>
Cc: "Paul Sanders" <p.sand...@alpinesoft.co.uk>; "Ramesh P" 
<ramesh.pauldu...@gmail.com>; <cocoa-dev@lists.apple.com>
Sent: Tuesday, January 26, 2010 6:51 PM
Subject: Re: How to access iTunes using cocoa



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
> inherently much faster, and your bottlenecks are then your 
> choice of
> Apple
> event and how long the target takes to process each Apple 
> event.

AppleScript isn't fast, but you'd have to scale up to much, much
larger data sets to see a real slowdown. I've done a fair bit of
iTunes scripting using [NS]AppleScript, and when the scripts 
have run
slowly, it's always been iTunes itself at fault. (Its AE object
resolution support is pretty naively written and doesn't 
implement any
of the fast-querying shortcuts, instead just doing linear 
searches
over the whole library.) So it wouldn't matter what technology 
you
used to send the events, because all the time is spent waiting 
for
iTunes to send a reply.

—Jens 



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to