Re: General questions from a non-Applescript coder.
Re: General questions from a non-Applescript coder.
- Subject: Re: General questions from a non-Applescript coder.
- From: has <email@hidden>
- Date: Wed, 27 Apr 2005 21:05:07 +0100
Shawn Milo wrote:
>Hi! I've only been a Mac user since January, but I'm an experienced
>coder in VB, VBScript, JavaScript, and Net.Data. I also have some
>working knowledge of Python, Perl and bash scripting.
>1. Should I learn Applescript? To some extent, it seems foolish not to
>stick with Python and bash scripting, since that's applicable outside
>of the Mac environment, and I can share code with more people. Is this
>a case where the answer depends solely on whether I intend to script
>to Mac apps such as iTunes and Finder, or just do other
>maintainance/one-off scripts?
Depends what you want to do:
Python has pretty solid application scripting support now; see <http://freespace.virgin.net/hamish.sanderson/appscript.html>. There should be a new version out next month (just waiting for Tiger) that'll polish out most of the remaining rough edges; the only other thing is that the documentation and examples are still a bit thin so for now you'll need to fill in some of the theory behind application scripting from AS-oriented docs.
Perl provides something similar in the shape of Mac::Glue <http://search.cpan.org/dist/Mac-Glue>, though since I've not used it myself I can't really say what it's like. Community support for application scripting on either is currently much smaller than for AppleScript, but it is growing and folk will certainly do their best to help you.
OSA support amongst third-party languages is a bit of a problem though. Late Night Software has a somewhat quirky though reasonably usable JavaScriptOSA component <http://www.latenightsw.com/freeware/JavaScriptOSA>, Philip Aker has been doing good work on OSA-ifying about half a dozen different languages <http://homepage.mac.com/philip_aker/osa/osa.html>, though most have only partial OSA support so far, and I'm working on an OSA component for Python too (but it's not fit for public consumption yet). Also, not all applications that employ OSA provide official support for OSA languages other than AppleScript; e.g. Studio's an obvious example (though you can hack it yourself to use other OSA languages if you really want to).
So if you want to attach scripts to applications like System Events (Folder Actions) and Mail (Mail Rule Actions), or write applications and Automator Actions in Studio, then you're probably best off sticking with AppleScript, at least for now.
>2. When Automator is used, and the procedure is saved, is it in
>Applescript? I can see how being able to share and edit these scripts
>would be immensely useful.
Nope, it's in Automator format. Presumably fully shareable and editable - we'll find out Real Soon Now.
>4. In the reviews for the "Definitive Guide," it is made pretty clear
>that Applescript has, or at least had, "as a language and development
>environment has some terrible problems," and "when you're banging your
>head against the keyboard because a script doesn't work as expected,
>it's good to know that the language is not without unique
>'personality' and that you're not alone." Those two quotes were from
>two separate, well-written and coherent reviews, written in 2004. Has
>the language evolved since then?
The language hasn't evolved much since the mid-90s. To be fair, while AS's own faults cause their own share of head-banging these are mostly well-known and dealable with. The majority of hassles scripters encounter tend to come from automating individual applications - the quality, quality and style of scripting support varies widely between apps, and many apps provide only partial documentation of their scripting interfaces. It's just something you have to deal with: the community will help out with advice and example code, of course, and don't be shy about filing bug reports and feature requests with application developers so they'll improve their products over the longer term.
HTH
has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden