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 Tue, 6 Nov 2007 16:02:14 -0800, Christopher Nebel <email@hidden>
said:
>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.

That doesn't work either. Perhaps I ought to have mentioned that. (It works
if BBEdit already happens to have a window open, but that is not the testbed
situation.)

>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]

So in effect your answer is, "Don't do that: don't use Scripting Bridge to
drive BBEdit since that isn't the kind of app we designed it for." Well, not
to put too fine a point on it, I would have to regard that as a fatal flaw
in the whole notion of the Scripting Bridge. Naturally when you are in
charge of the Scripting Bridge and of Cocoa Scripting you can jigger them
both so that they match. But that is not the challenge. The challenge is to
create a Scripting Bridge that can drive existing third-party applications
in the well-established language to which they are accustomed. Instead:
"Brave Sir Robin ran away, brave, brave Sir Robin..." m.

-- 
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: <http://tinyurl.com/2rh4pf>
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>



 _______________________________________________
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



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.