• 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
Scripting Bridge && filteredArrayUsingPredicate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scripting Bridge && filteredArrayUsingPredicate


  • Subject: Scripting Bridge && filteredArrayUsingPredicate
  • From: led248 <email@hidden>
  • Date: Wed, 26 Dec 2007 15:10:54 -0800

Anybody using Scripting Bridge with filteredArrayUsingPredicate ???

I've tried Apple's example code -- it's the last code snippet in "Scripting Bridge Release Notes for Mac OS X v10.5" http://developer.apple.com/releasenotes/ScriptingAutomation/RN-ScriptingBridge/index.html

But it does not work. Looked around the web and don't see any other examples. Has anyone gotten filteredArray to work?


Error in statement 3:
FinderApplication *finder = [SBApplication applicationWithBundleIdentifier:@"com.apple.finder"];
NSPredicate *startsWithM = [NSPredicate predicateWithFormat:@"name BEGINSWITH 'M'"];
>>> SBElementArray *desiredDisks = [[finder disks] filteredArrayUsingPredicate:startsWithM];
NSArray *nameArray = [desiredDisks arrayByApplyingSelector:@selector(name)];


Generates this compile warning:
    warning: initialization from distinct Objective-C type

And this error when run:
Apple event returned an error. Event = 'core'\'getd'{ '----':'obj '{ 'want':'prop', 'from':'obj '{ 'want':'cdis', 'from':'null'(), 'form':'test', 'seld':'cmpd'{ 'relo':'bgwt', 'obj1':'obj '{ 'want':'prop', 'from':'exmn'($$), 'form':'prop', 'seld':'pnam' }, 'obj2':'utxt'("M") } }, 'form':'prop', 'seld':'pnam' } }
Error info = {
ErrorNumber = -1728;


_______________________________________________

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


  • Prev by Date: Re: Standard Cocoa Save Panel crashing in Leopard
  • Next by Date: Predicates
  • Previous by thread: Re: capturing text from window in external application
  • Next by thread: Re: Scripting Bridge && filteredArrayUsingPredicate
  • Index(es):
    • Date
    • Thread