Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: jumpstart me with the scripting bridge



On Nov 6, 2007, at 3:54 PM, Bill Cheeseman wrote:

on 2007-11-06 3:52 PM, Matt Neuburg at email@hidden wrote:

[[bb textDocuments] addObject:doc];

I'm not familiar with BBEdit's dictionary, but what if you changed this to:
[bb addObject:doc];

That won't work, because bb is the application itself, which means it isn't an array. Try using -insertObject:atIndex: instead.


When you say "addObject", Scripting Bridge has to send an event to the application to do that. The problem is that there are at least three different ways to express that (with a position, without a position, and with a container; more if you count the different ways of expressing a position), and a lot of applications only understand one of them. We went with the one that all Cocoa apps understand ("...at end of..."), and there's no way to override that. [1]


--Chris Nebel AppleScript Engineering

[1] Well, no straightforward way, anyway. You could get sneaky with the -eventDidFail delegate method, and re-jigger and re-send the event if you see it fail.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-implementors mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-implementors/email@hidden


This email sent to email@hidden
References: 
 >Re: jumpstart me with the scripting bridge (From: Bill Cheeseman <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.