« Dildo has issues | Main | A look at AppleScriptObjC »
From the new Acorn 2.0 release notes:
I actually came up with JSTalk specifically for Acorn. I was looking at adding AppleScript support to Acorn, since scriptibility was a big feature request, but I've always found AppleScript to be too cumbersome. And I hate writing examples in AppleScript, so JSTalk it is.
That sound was my interest in the product fading away. Not because I hate Javascript, even though I do. Because sometimes, JS is the best tool for the job, and you use it anyway. But because Apple does make creating an language-neutral scripting interface doable, (dude, it's a 10.6 only application, so screw legacy support, there is none, and besides, in 10.6, AppleScriptObjC really does put AppleScript on the same level as Ruby and Python), and there are hundreds of people who if you ask, and maybe throw in a license or two of Acorn and a thank you, will write your examples for you.
Secondly, if you're going to rag on AppleScript because it's "too cumbersome", then don't have shit like this on your jstalk sample page:
Give me an example Here's an AppleScript example, for adding a new rectangle object to a sketch document:tell application "Sketch"
tell document 1
set o to make new box
set width of o to 100
set height of o to 100
set stroke thickness of o to 10
end tell
end tellAnd here's how you do it with JSTalk, using a doctored version of Sketch (6 lines of code, + the JSTalk framework):
var sketch = [JSTalk application:"Sketch"];
var doc = [sketch orderedDocuments][0]
var rectangle = [doc makeNewBox];[rectangle setWidth:100];
[rectangle setHeight:100];[rectangle setXPosition:100];
[rectangle setYPosition:100];If you aren't a fan of the optional bracket syntax, you can also write the script this way:
var sketch = JSTalk.application_("Sketch");
var doc = sketch.orderedDocuments()[0]
var rectangle = doc.makeNewBox();rectangle.setWidth_(100);
rectangle.setHeight_(100);
rectangle.setXPosition_(100);
rectangle.setYPosition_(100);
if there's some fucking magic here that makes "set o to make new box" less cumbersome than "var rectangle = doc.makeNewBox();" or "var rectangle = doc.makeNewBox();", I'm totally missing it.
Note that the example AppleScript Gus shows is actually more cumbersome than it needs to be, because the way to do this is to make width, height, stroke, xPos, and yPos properties of box, so you could do it as:
set o to make new box with properties {height:100, width:100, xPos:100, yPos:100, stroke:10}
Yep, that's so cumbersome.
But like computers, programming languages all suck anyway. The ones you like? They suck. The ones I like? They suck too. If however, they suck the right way, and you can wrap your head around them, then you can use them. But they still suck.
As to Gus disliking AppleScript, he must really dislike it. There's nary a post on either AppleScript-Implementors or AppleScript users asking either for tips in implementing a dictionary, or help with examples. Kind of hard to get help when you never ask for any. Funny how that works.
As well, Gus seems to either miss, or not care that he's kind of cutting Acorn off from the larger Mac OS scripting community. Because by writing a language-specific scripting implementation, now, if you want to have scripts that say, shove data into or get data out of Acorn, you have to either do all the bridge work to JSTalk yourself, or, you have to start writing Objective C code:
But no apps out there currently support JSTalk! Applications can also be scripted using Cocoa's Script Bridge class, SBApplication. Here's an example:[[SBApplication application:"iChat"] setStatusMessage:"Happy (funball)"];
Although this is great to have, it's not the same as an application natively support JSTalk over DO. Anything more than simple tasks using SBApplication tends to be a little more than difficult.
No kidding. Again, let's see how cumbersome this would be in AppleScript:
tell application "iChat" to set status message to "not that hard after all"
Wow. That's pretty cumbersome. Thank God we have a way to avoid such onerous syntax.
Yes, I know, the snark is cranked, but too bad. If Gus felt that writing his own language-specific scripting implementations was the best way to go, fine, then say that. See, it's easy:
"For Acorn, none of the existing scripting implementations did what I wanted, so I rolled my own." See? Easy, and you're standing on your own two feet. But don't hide behind some bullshit like "I hate writing AppleScript sample code" when as near as I can tell, (based on searching for Acorn, Gus, Mueller, or Gus Mueller), you never even bloody looked into it because of your feelings towards AppleScript. Given the way you write AppleScript examples, I don't see a lot of experience with the language.
That's not AppleScript's fault, that's your goddamned decision all on its own, so put your fucking big boy pants on and stop letting others be your fall guy.
Comments
Warning for Notes users: The commenting system uses HTML.I know this will be scary for some of you, especially Notes fans. However, open standards, rah-rah.
If you want to use less-than or greater-than signs, or other similar charachters that HTML reserves,
you'll simply have to learn to do it the HTML way. Luckily, HTML is kind of popular, no matter what
your re-educators have told you, and you can easily find help on the intertubes.

