Re: Javascript for automation quastions
Re: Javascript for automation quastions
- Subject: Re: Javascript for automation quastions
- From: has <email@hidden>
- Date: Sat, 13 Dec 2014 21:35:19 +0000
Deivy Petrescu wrote:
> “this” as "me" never occurred to me, because "self" and “me” seems to
point to the other direction….
> But it was my disattention. It was clear it should be “this"
It's not clear at all. Nothing is self-evident or should be taken for
granted. It should be fully documented. The AS team have failed to do
this for JXA, just as they did for AppleScript-ObjC before it. After
WWDC14 I was basically offering to write the whole damn book for them,
just as Shane did for ASOC, but how am I supposed to sell a book where
every page says "[feature is missing/broken/obfuscated beyond
understanding]"?
> I am not a proficient Javascript scripter, I come from the AS side.
It's not a JavaScript issue. It's a JXA one. Like I say, these things
need to be documented for JXA.
> However, I never thought that that parameter type checking was
supposed to be used in the particular case.
It's not. It's a design misfeature due to Chris N trying to be clever,
failing (in Scripting Bridge), and doubling down on that fail (JXA)
instead of just admitting he's wrong and doing it over right. My first
attempt at appscript made the same mistake, but as an AppleScript *user*
myself I could see it was wrong, and threw the whole thing away and did
it over again from scratch. But hey, I'm just a dumb LUser, not one of
those Real Programmers, so what do I know?
> The dictionary is my bible and I don’t question it.
As a user, you really should. Religion's for the programmers.
The _only_ information in a dictionary that is [almost] guaranteed to be
correct is a keyword's name, four-char code, and kind (i.e. is it a
class/property/enumerator/etc. name?). This is because this is the
_only_ information that AppleScript itself uses. Everything else -
property and parameter types, class properties and elements, inheritance
structure, etc. - is for user documentation purposes only, as far as
Apple event *clients* are concerned.
AppleScript is the de facto specification against which all Apple event
bridges must be implemented in order to provide the same level of
functionality and application compatibility as AppleScript does. Diverge
from that specification in even the smallest, most well-intentioned way,
and you break the spec and almost certainly break capabilities and
compatibility as a result. I learned that lesson within the first year
of appscript development, ate my humble pie, and eventually produced a
nearly AppleScript-quality Apple event bridge after another three years
of exhaustive real-world field-testing and production use by myself and
hundreds of others.
Whereas the AppleScript devs have had *seven years* from which to learn
from their previous mistakes, yet have almost completely failed to do
so. I'm not kidding when I say SB and JXA are unfit for production use:
I've spent 5000-10,000 hours studying, developing, supporting, and
*using* Apple event bridges - both my own and every since other, all the
way back to Frontier, and I *know* what it takes to make this stuff work
right, because I've learned from all my own errors as well as all the
successes and errors of all the other Apple event developers before me.
> Now I (hope) I got it and I would know how to solve the problem, if
it happens again, but it would be my suggestion that somehow this
example could be incorporated in the release notes, I believe it would
help AS scripters during the transition period.
There is no transition period: JXA is UTTERLY UNFIT as an AppleScript
replacement. You think I'd be saying this if it wasn't? Hell no, I'd be
bloodly minting it selling ten thousand "JavaScript for Mac OS X
Automation" books this Christmas at $20 a pop, and pulling in great
juicy consultancy and training fees for years to come.
If Apple even *think* of downgrading AppleScript in favour of JXA then
the whole platform is utterly fucked, and we'd all better find a new
home on Windows or something, because even MS care more about this stuff
than Apple do.
Regards,
has
_______________________________________________
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