Re: Scripting Bridge && filteredArrayUsingPredicate
Re: Scripting Bridge && filteredArrayUsingPredicate
- Subject: Re: Scripting Bridge && filteredArrayUsingPredicate
- From: has <email@hidden>
- Date: Thu, 3 Jan 2008 16:48:24 +0000
On 3 Jan 2008, at 02:14, email@hidden wrote:
Thanks for taking the time, has. Sounds like my best option is to
check for empty strings, iterate over the search result if necessary
and manually delete non-matching objects from the SBElementArray.
IMO, your best option would be to use appscript. Appscript objects
look and behave like appscript objects, Cocoa objects look and behave
like Cocoa objects, and neither goes around pretending to be something
it's not, so you can actually see what's going on when you use it. But
that's your choice, of course.
If you do use SB, bear in mind that calling 'delete' on an SBObject
will delete the corresponding object in iTunes, which I suspect isn't
what you're actually meaning to do.
For a non-trivial task such as this, since you're still in the process
of figuring out SB I would suggest you write your iTunes-related stuff
in AppleScript first and test and debug that till you're happy it
works as intended. You can then port it over to SB, checking the SB
version to make sure it behaves the same as the original AppleScript
version. For information on AEDebug, which is handy for observing the
Apple events being sent between applications, see:
http://developer.apple.com/technotes/tn2004/tn2124.html#SECAE
If you need advice on how to perform specific operations on iTunes,
ask here or on AppleScript-users describing in general terms the task
you want to perform. The AS-users folks will be able to provide
AppleScript-based answers which you can translate as necessary, and
I'm happy to provide AppleScript/appscript-based answers (within the
limits of my iTunes knowledge) although I've little patience for
Scripting Bridge-specific issues past the point I start scratching my
own head at it.
HTH
has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
_______________________________________________
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