Re: Snow Leopard AppleScript Release Notes
Re: Snow Leopard AppleScript Release Notes
- Subject: Re: Snow Leopard AppleScript Release Notes
- From: Christopher Nebel <email@hidden>
- Date: Fri, 28 Aug 2009 15:50:02 -0700
On Aug 28, 2009, at 1:41 PM, has wrote:
Additional AppleScriptObjC release notes here:
<http://developer.apple.com/mac/library/releasenotes/ScriptingAutomation/RN-AppleScriptObjC/index.html
>
...
A few initial questions for the AppleScript team:
1. I've also seen ASObjC referred to as Cocoa Bridge, but I'm
guessing the official name is AppleScriptObjC, yes?
Correct.
2. Is more AppleScriptObjC documentation in the pipeline, or is this
all of the AppleScript-specific information? Obviously, the Cocoa
APIs are covered is in the Cocoa documentation proper; the ASObjC
docs only need to explain how to map that to AppleScript code.
There are some details the current document doesn't cover that should
be filled in soon. In general, it's as you guessed: AppleScriptObjC
reference material describes how to map between AppleScript and Cocoa,
and nothing else. Beyond that, we're working on sample code.
3. The ASObjC release notes provide some information on the AS-ObjC
bridging. Offhand, one thing I don't see is covered is implementing
class methods in AppleScript. (The docs state "AppleScript handlers
defined in the 'script' block are equivalent to the **instance**
methods of an Objective-C object" [my emphasis].) Am I correct in
thinking this is not supported?
I should fix that sentence. In fact, a handler serves as both an
instance method *and* a class method; you can invoke it either way.
4. What other limitations are imposed by the bridge? For example:
- Can ObjC classes inherit from AppleScript 'classes' (top-level
script objects)?
No, because there's nothing the Obj-C linker can see. (Technically,
you could create a class dynamically that inherited from an
AppleScript-based class, but that's more trouble than most people want
to deal with.)
- Can AppleScript 'classes' inherit from other AppleScript 'classes'
using the 'property parent : class "CLASSNAME"' mechanism? If not,
can they still inherit via the traditional AppleScript approach?
I believe that both work, though in the former case you have to be
careful about load order.
- When mutable objects cross the bridge, are they copied or shared?
I'm assuming they're shared, yes?
Shared. Obj-C objects stay Obj-C objects when they cross; there is no
automatic "boxing" of, say, NSStrings to AppleScript text.
5. I expect I'll have more questions as I investigate ASObjC
further. What's the best forum to use? Here or the Studio list? Or
are there plans to create an AppleScriptObjC mailing list?
For now, use the Studio list; we'll look at creating a separate list
in the future.
--Chris Nebel
AppleScript Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden