Re: Snow Leopard AppleScript Release Notes
Re: Snow Leopard AppleScript Release Notes
- Subject: Re: Snow Leopard AppleScript Release Notes
- From: BareFeet <email@hidden>
- Date: Sat, 29 Aug 2009 13:38:04 +1000
Hi all,
The Snow Leopard 10.6 AppleScript Release notes are up:
<http://developer.apple.com/mac/library/releasenotes/ScriptingAutomation/RN-AppleScriptSL/index.html
>
The way we create AppleScript applications has fundamentally changed.
It seems that old projects (AppleScript Studio) will no longer work in
the new XCode (which now does AppleScript Cocoa).
I'm concluding that Apple has abandoned AppleScript Studio since it
just wasn't getting around to completing the implementation.
Note that when calling Objective-C methods and defining handlers
that will be called by Objective-C code, it is necessary to rewrite
selector names with underscores in place of colons. If there are
multiple arguments, all are passed in the comma-delimited,
parenthetical expression following the selector name, rather than
inline with the selector name as in Objective-C.
While it's great to see AppleScript fully support Cocoa methods, why
must it be done in such an ugly non-AppleScript fashion? Underscore
delimited labels and comma separated arguments? What are you thinking?
Why not use the labeled parameter syntax that's been available in
AppleScript forever?
For example, here's a Cocoa method for NSTableView:
selectColumn:(NSInteger)columnIndex byExtendingSelection:(BOOL)flag
and here's an example of using it in Objective-C:
[MyTableView selectColumn:3 byExtendingSelection:TRUE];
which I would have expected to appear in AppleScript syntax as:
tell MyTableView to selectColumn of 3 given byExtendingSelection:true
but it instead seems to require syntax like this:
tell MyTableView to selectColumn_byExtendingSelection_(3, true)
This syntax gets increasingly hideous as you use methods with more
parameters or nest method calls. Positional parameters are not
"English like" and is a major diversion from the AppleScript strengths.
The new AppleScript syntax is harder to read than the Objective-C
equivalent. Surely, Apple, you could keep each parameter with its
label in AppleScript?
Tom
BareFeet
_______________________________________________
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