JavaScript for Automation [was: Re: Swift & AppleScript]
JavaScript for Automation [was: Re: Swift & AppleScript]
- Subject: JavaScript for Automation [was: Re: Swift & AppleScript]
- From: has <email@hidden>
- Date: Tue, 03 Jun 2014 21:16:13 +0100
On 3 Jun 2014, at 10:11 am, John Day wrote:
> How does Swift fit into the picture with ASObj-C ?
While Swift may be generating all the headlines, the following is of
rather more significance (good and/or ill) to the AppleScript community:
https://developer.apple.com/library/prerelease/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/index.html
So, a much more useful question to discuss is: what effect
could/should/will Apple's upcoming JavaScript OSA component have on the
"AppleScript" ecosystem as a whole?
There are certainly plenty folks both inside and outside Apple who'd
like to see JavaScript established as an equal alternative, if not
outright replacement, to AppleScript. (JavaScript has plenty faults as a
language too, but the one key thing it's no shortage of is active users.)
That said, there's been many attempts over the last two decades years,
both by Apple and third-party developers (incl yrs trly), to create
Apple event bridges and/or OSA language components that are *as good as*
(or even sufficiently close to) AppleScript for these two tasks. And all
of those attempts have ultimately failed: almost all of them screwed up
on the design and implementation, which meant lots of stuff that works
perfectly in AS blows up, or isn't even possible, when attempted in
other AE bridges/OSA components.
The only AE bridges that were ever good enough to genuinely replace
AppleScript for application automation were UserLand Frontier's and (my
own) appscript. The only language plugins that supported the full set of
OSA capabilities correctly were (AFAIK) Frontier and Late Night
Software's JavaScriptOSA. And even those that got the techical stuff
right ultimately went on to fail anyway, because they didn't attract
enough users to kick start self-sustaining growth [1]. You can create
the most brilliant technology in the world, but without dedicated
evangelism and community-building work, that product is not worth squit [2].
...
So Apple's new JavaScript OSA component has two advantages and at least
two disadvantages going for and against it. Pros:
1. JavaScript has a huge base of existing users, ready for JS4A to exploit.
2. It's bundled as standard in the OS - no fiddling with installers and
permissions - meaning users can get started straight away and readily
exchange scripts with each other.
Cons:
1. It uses Scripting Bridge for its Apple event support, which is
exactly as flawed and broken after 7 years and 5 major OS updates as it
was on the day it was first released. It's an 80/20/80 "solution": 80%
of the time it works, 20% it doesn't, and 80% of the time you'll have no
clue why. Scripting Bridge was in a golden position to revolutionize the
AppleScript ecosystem by creating tens of thousands of enthusiastic and
skilled application scripters amongst the ObjC, Python, Ruby, etc.
fraternities. Yet I doubt it could muster even a thousand [3], partly
because it's technically inferior to AppleScript(!), but also because
nobody inside or outside Apple has ever done a thing to educate or
evangelize it [4].
2(ish). It's also been built as an OSA language plugin. While OSA was
incredibly powerful and brilliant in concept, its actual implementation
is painful, fragile, and now seriously obsolete too; inherently
incompatible with modern OS X application architectures and sandboxing
requirements. Gutted of its true capabilities and potential, what
remains is just a joke. It's a real shame Apple didn't take this
opportunity to create a modern, 10.10-friendly language plugin system:
not just for the sake of JS4A, but also to revitalize "attachability"
support amongst app developers in general, which would ultimately
benefit ASers too (plus it'd give other languages like Python and Ruby a
fighting chance at developing first-class language plugins too).
3. I don't know if JS4A is being developed and promoted solely by the AS
team, or whether it's being developed and promoted by another team, or
what; however, the AS team and Apple in general have a pretty dire
record at doing all that educating, evangelizing, community-building,
and support work that, ultimately, is the real key to achieving popular,
self-sustaining success.
Look at Dashboard, look at Automator, look at SB, look at
AppleScript-ObjC, look at the AppleScript library system added in 10.9:
in every case, there's a brief flurry of activity and publicity from
Apple, then absolutely nada: no follow-through, no nothing. Of those
examples, the only one that's gained any sort of stable community
support is ASOC, and that's because Shane Stanley loved it so much that
he's single-handedly stepped up to do Apple's job for it. (Honestly, the
AS team should be paying Shane a salary.) And even there, if you look at
online mailing lists, blog posts and so on, and you see very little talk
about ASOC, very little sign that it's a technology that's
well-supported and thriving, and therefore something potential new users
should pick over higher profile, healthier-looking competition. If Shane
were to retire from the AS world tomorrow, would the rest of the ASOC
community manage to fill his place?
...
In the last several years there's been negligible growth in the number
of scriptable applications available, while the overall number of Mac
applications has soared; which as anyone in business will tell you is
Not Good. The print industry might've saved AS once, back when it was a
major core Apple market, but it no longer is, so don't expect it to do
so again. Significant injections of new blood are *desperately* needed
now to guarantee AppleScript's long-term survival, regardless of which
language they actually use to control their apps.
Otherwise, the entire AppleScript world, which has been worryingly
stagnant for some time now, will find its position increasingly insecure
as the percentage (and quality) of scriptable applications continues to
decline. Scriptable applications are AppleScript's *total* reason for
existing; without them, AppleScript will fade and die overnight.
So basically, JS4A: nice idea in theory, could create a large number of
new application scripters; but only if Apple seriously beat out all the
technical defects and throw non-trivial time and effort into developing
a true, sustainable community and ecosystem around it. Otherwise, unless
it lucks out and finds its own Shane, it's just being set up as the next
Dashboard-like washout, and wasting everyone's time (again).
Food for thought, anyway. Regards,
has
--
[1] See: Network Effect
(https://www.princeton.edu/~achaney/tmve/wiki100k/docs/Network_effect.html).
'Cos once the growth stops, it's only downhill from there.
[2] The flip-side being that even a completely shitty technology can
succeed beyond the devil's wildest dreams as long as it's the one that
grabs the biggest, most active, and enthusiastically evangelical user
base first (just ask PHP).
[3] Getting your first 1000 permanent users is generally considered the
magic tipping point at which you've at least a chance of achieving
long-term success vs never amounting to anything. I think appscript
might've gotten close to that number before losing momentum (my bad),
and appscript had a lot more fans pulling for it than SB ever did.
[4] Although given SB's inferiority to AS for application automation,
I'd question the knowledge/competence/sanity of anyone who would. The
only folks I've ever heard gush over it are those who've never used it
for anything non-trivial, because as soon as they start it's only a
matter of time till it blows up in their face. (And I've heard what they
said after that happened, too.:p)
_______________________________________________
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