Re: Applescript coding
Re: Applescript coding
- Subject: Re: Applescript coding
- From: has <email@hidden>
- Date: Tue, 19 May 2015 17:36:27 +0100
Thomas Floeren wrote:
> I like Script Editor very much so far but I've been using
TextWrangler/BBedit a lot in recent years (and BBEdit Lite before that),
and I was wondering about the lack of support for Applescript syntax in
them.
Because AppleScript editing is a giant PITA to do right, and
*impossible* to do well (e.g. instant syntax checking, highlighting,
tooltips, and auto-completion as you type, which any decent coding
environment ought to provide nowadays).
AppleScript's syntax rules are heinously complicated (ironic for an
"end-user" language), ambiguous as hell (due to a total lack of
meaningful punctuation), and utterly impossible to predict (since apps
and osaxen can inject new terminology at any time). The only thing that
knows how to read AppleScript code is AppleScript's own parser, and the
AppleScript component is absolutely notorious for not playing well with
others - its total lack of debugger support being another massive,
enduring fault [1].
The AppleScript team could do a lot to address this problem, e.g. by
providing decent API hooks into the AppleScript parser that allows
third-party tools to incrementally parse AppleScript code into a format
they *can* use (such as a concrete syntax tree), but as with debugging
support if they were going to do that they'd have done it years ago.
Unfortunately the AS team is more interested in finding new ways to
screw things up than fix the screwups they've already got, and refusing
to play well with others has always been AppleScript's SOP anyway. So
you really can't blame the likes of BBEdit and Xcode devs for throwing
up their hands in defeat: it simply isn't worth their time to deal with
all of AppleScript's BS when there's virtually no user demand compared
to other far more popular - and cooperative - languages.
If you have to write AppleScript code, either use OS X's crappy Script
Editor or get yourself a third-party editor (Satimage Smile or Script
Debugger) that's built specifically for the task, and set your
expectations accordingly.
HTH
has
[1] The OSA API, which is what editors and other apps use to interact
with AppleScript, actually used to provide a debugger interface.
However, rather than add debugger support to the AppleScript interpreter
so that apps could actually make use of it, Apple completely eliminated
that interface instead. Figuring out how this could possibly constitute
"progress" is left as an exercise to its users.
_______________________________________________
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