On Fri, Oct 30, 2009 at 12:55 PM, Scott <scottsc...@gmail.com> wrote: > Through some help I was able to get this resolved. My problem was I > didn't look at SBElementArray closely enough. I thought it was only > used to get objects not pass them back to an application. Makes sense > that Scripting Bridge needs to use it's own array's now that I think > about it. I was trying to create a new array. Anyway for anyone in the > future who is as bad at reading the developer docs as I am here is a > working example of what I was trying to do it is actually pretty > simple.
There are some quirks… the -exists method that the documentation prescribes doesn't actually exist. So this doesn't work (using OmniFocus names here because I don't have Airfoil): OmniFocusDocument *document = [[[OmniFocus documents] objectWithName:@"OmniFocus"] exists]; This results in a compiler error; defining this method instead results in unrecognized selector exception. Then I tried using -get: OmniFocusDocument *document = [[[OmniFocus documents] objectWithName:@"OmniFocus"] get]; BOOL exists = (document != nil); But that didn't work because that's not how documents are identified. So finally, this worked for Mail.app: MailMailbox *mbox = [[[Mail mailboxes] objectWithName:@"ToDos"] get]; BOOL exists = (mbox != nil); So there you have it. --Kyle Sluder _______________________________________________ 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