Applescript worth it?
January 5, 2006 12:32 AM   Subscribe

Learning applescript, worth it?

I switched from windows to a mac about a year ago on a whim, almost an experiment. Long story short, I'm never going back. Now that I know I'll be staying on the mac platform, I'm curious about applescript. Is it worth learning? Is it more a hobby or done for fun or can it really make the experience better. And even if it does add to the mac experience, would I just be better off using canned scripts? Does automator make applescript obsolete (I'm still on panther)?

Basically, worth taking the time to learn?
posted by gtr to Computers & Internet (16 answers total) 1 user marked this as a favorite
Although I am an AppleScript fan, it is not the easiest language to learn, largely because each scriptable application has its own terminology, and not all applications are equal in their object model exposure. The language, once written, often looks deceptively like English, but it has rules (like any programming language) that are not English-like. Learning a boatload of new syntax and the object models of the apps you want to script, both at the same time, might be a bit overwhelming. Do you have any scripting experience already? What is your general level of experience with programming?
posted by kindall at 12:37 AM on January 5, 2006

Response by poster: None. I mean, I can write html/css etc, and i know that's not programming. I took a java class once that I dropped. Ha.

One reason I thought about applescript is because all the book covers talk about how easy it is to learn. But it's not, huh?

Even if it's difficult, I'd be willing to put in the time if it has real applications. If it's more of just a geek hobby or more of a fun past time I'd probably pass on it.
posted by gtr at 12:44 AM on January 5, 2006

Unless you have specific needs, there's probably no need to use it. I am a fairly advanced Mac OS X user, and I've never written an AppleScript, if that puts your mind to rest.
posted by jbb7 at 1:01 AM on January 5, 2006

If you'd like to be able to script Mac applications, but would prefer to do it in a more widely applicable language, you could try using Python and appscript.

Python's easy to learn, and the syntax is more straightforward than AppleScript, from what I hear. On the down side, learning Python+appscript is probably slightly more work than learning AppleScript alone. But Python's definitely worth learning.
posted by wilberforce at 2:26 AM on January 5, 2006

There are a lot of cool things you can do with a bit of Applescript, but the pseudo-english makes me crazy. The syntax is not very rigid and sometimes I just wish they'd create an Applescript++ that used Java wrapper classes, or something.
posted by bshort at 6:20 AM on January 5, 2006

I had fun working through AppleScript: the Missing Manual. This took just a few days, and I learned enough that since then I've been able to write a couple of useful utilities for myself.

I have not used it as much as I thought I might. The big problem is that AppleScript is just a jumble of special case rules, special case syntax, special case datatypes.

It's certainly not essential. If you're interested in Mac Hacking, you might do better checking out Automator. If you're interested in extending your web skills, you'd do better learning something more widely used, like php+mysql, python, etc. You could also get into the Unix side of the Mac with something like Learning Unix for Mac OS X Panther (which is good other than being overpriced).
posted by alms at 6:40 AM on January 5, 2006

Related question: How much Applescript do you really need to learn to create Automator scripts?
posted by lodurr at 6:56 AM on January 5, 2006

(I ask because that looks to me like an alternate solution.)
posted by lodurr at 6:56 AM on January 5, 2006

You don't need to know any Applescript to write Automator scripts.
posted by bshort at 7:01 AM on January 5, 2006

Haven't used Automator yet, but I gather that no applescript is necessary. I don't see how it could be as expressive as writing programs, but it's getting good reviews, so by all means, have a look.

I've actually used applescript to make an iTunes script to help me DJ with iTunes. I didn't really learn the language, but pieced it together from examples, and trial and error. For quick little scripts like mine, you can probably get by without having to buy a book.

Also, a quick way to learn an app's dictionary is to: Open applescript editor, open the app you want to script, drag the app's dock icon to applescript editor's icon. Voila.
posted by Popular Ethics at 7:09 AM on January 5, 2006

If you're going to learn a scripting language, learn python or ruby. It's about the same difficulty, but more universal.
posted by voidcontext at 7:57 AM on January 5, 2006

I've also patched together bits of publicly available scripts to create Applescripts that are useful to me. It definitely takes some trial and error this way, and I do know a bit about coding.

I keep telling myself that one day, I'll buckle down and really learn the language, but that day never comes (somewhere in the back of my mind, Hypertalk keeps getting in the way!).
posted by adamrice at 8:26 AM on January 5, 2006

Applescript is good if you need to do specific things with an Applescript-enabled app. I used it a couple of years ago to automate the process of encoding large amounts of DV footage using RealProducer.

For general scripting though, UNIX shell/python/perl/etc is best.

posted by mrbill at 8:26 AM on January 5, 2006

I don't know AppleScript and have been thinking about learning it.

On Automator: it's neat. But it is not a programing language or environment, and as a programmer I am constantly annoyed by it's limitations. But, it's dead simple and can streamline some annoying, repetitive tasks. And it can call shell scripts, which is really nice for me, because I already know how to write scripts (née programs) in Bash and Perl. Bash and CocoaDialog is what I'm probably going to learn next.

But I've seen enough cool AppleScripts floating around in the year since I switched to a Mac that I'm pretty sure I'm going to eventually learn it.
posted by teece at 10:01 AM on January 5, 2006

There's no real need to learn Applescript unless you have a specific problem you want to solve. I used it to coordinate FileMaker & QuarkXPress to create in a student directory. It worked fantastically, and I don't know any other way I could have accomplished it without using AppleScript.
It is very simple to learn. You don't run into any trouble until something that looks like it should work doesn't, and then it can be a pain to figure out why or work around it.
posted by designbot at 10:08 AM on January 5, 2006

Response by poster: Thanks everyone. I appreciate all your advice.
posted by gtr at 10:59 AM on January 5, 2006

« Older creating simple biofeedback software   |   Helpful Hints for the First Time Mover? Newer »
This thread is closed to new comments.