Tuesday, June 3, 2003

Cocoa AppleScripting

Buzz Andersen:

Read any article about AppleScript and Cocoa (see Andrew Stone’s tutorial for example), and chances are you’ll be told right off the bat how easy it is, thanks to the wonders of key-value coding, to add AppleScript support to a properly designed application. What these experts might have forgotten, however, is that they’re right about it being easy—but only after you understand how to properly manipulate a bunch of fairly confusing XML!

Fortunately, there is Suite Modeler, which is much better than editing XML by hand. Unfortunately, it seems to be designed for screens the width of the Cinema Display and always leaves its daemon running.

4 Comments RSS · Twitter

I tried Suite Modeler but something about it didn't quite sit right with me. To me, it doesn't seem that much easier than simply editing the XML--although maybe I just haven't dug into it enough yet.

You know what I think would be really nifty? Something like Interface Builder, except for AppleScript. I'd like to see an app that would allow me to drag a header file out of Project Builder and have AppleScript properties, commands, etc. automatically generated (albeit with the ability to selectively enable or disable them). Seems like it might not be that difficult--I would imaging parsing the header file would be the hardest part. I could be wrong, though...

Yeah, I have very mixed feelings about Suite Modeler. At times it seems really clunky. But it's so easy to make stupid errors editing the redundant XML files by hand.

Interesting idea. I wonder how well it would work to define AppleScript terminology as structured annotations in the code.

Indeed--that almost continues the Enterprise Java analogy I made in my post. I don't know much about XDoclet, but I wonder if it could be adapted to create scriptSuite files? I'll definitely have to look into that one!

[...] I’ve been using Suite Modeler for about four years now. It helped me learn Cocoa scripting and saved me a lot of time, but frankly it was also maddening to use: the user interface remained rough, and it would crash and then not re-launch properly because it was out of sync with its daemon. Every once in a while there’d be bug fixes, but registered users weren’t told about them, and they often weren’t posted on Version Tracker. Daniel Jalkut reports that Suite Modeler 3.0 is out. It’s now universal and free, but I’m not sure what else is new—most of the documentation still refers to version 2.x. [...]

Leave a Comment