AppleScript Updated to 1.8.3
Warlock7 writes "Apple has made the 1.8.3 version of AppleScript available. You can get the update through Software Update." It's available for both Mac OS and Mac OS X, though, as usual, a detailed list of changes is hard to find, though some are in the accompanying About AppleScript file. It appears they've fixed bugs with coercing Unicode text (now I can fetch and use text from iTunes via Apple events), and Apple says it provides increased stability of scripts, and runs applications created with the latest version of AppleScript Studio.
It seems that the Installer is buggy and a lot of people have reported that it crashes on launch!
...yep, that happened to me too, but interestingly enough, one top -u in the terminal will show you that the actual install continues on. The installer crashed my iBook, but apparently only the Cocoa front end to the install was actually affected. The actual software install went ok, and the requisite update_prebinding post-install "optimization" automatically fired up afterwards as well.
Odd.
~jeff
Hi, I'm a Windows user who is buying his first Mac in a month or two (yep, OS X got me hooked, and hopefully I will never have to go back). I currently program in Python and was wondering about AppleScript - how does it compare to Python? You've mentioned that it's a bit more difficult to learn, and it's probably not as well designed (my guess), but how's the performance under OS X? I hear AppleScript Studio allows you to compile your scripts into apps. Is this true? What's the Python support like in OS X?
Basically, what I'm asking is: Should I pick up the O'Reilly AppleScript book now, or just stick with Python and Tkinter? Anything you can tell me would be great.
Thanks for your advice,
Michael M.
Here's a quick list of mini-AppleScripts i use almost every day at work:
You get the idea. Sure, lots of these could be done in other languages, but none of them took any time to write. AS is surprisingly powerful for these little uses, and runs very fast. It's a huge time-saver for me.
As for AppleScript Studio, it's a very cool thing, but it does add a level of complexity to the scripts. You're not just writing a little script, you're coding an app and interacting with the user - lots of additional complexity. It would sure make some pretty looking scripts though.
You've mentioned that it's a bit more difficult to learn, and it's probably not as well designed (my guess), but how's the performance under OS X? I hear AppleScript Studio allows you to compile your scripts into apps. Is this true? What's the Python support like in OS X?
Basically, what I'm asking is: Should I pick up the O'Reilly AppleScript book now, or just stick with Python and Tkinter? Anything you can tell me would be great.
If you currently program in Python, I would only bother with AppleScript for stuff that is difficult to do in Python (or rather, would take more coding). AppleScript is great for writing more-advanced macros -- for instance, an idea I've been toying around with is writing an AppleScript that calls a Perl script to parse a MySQL database dump and create an object in OmniGraffle to represent that in a database diagram. But you can see, even from this example, I would use another language (Perl) to parse the data and then use that to tell the AppleScript how to interact with OmniGraffle and draw the object. If the Perl OSA becomes more mature, I can bypass AppleScript altogether.
Basically, I think it can be useful, esp with AS Studio, to create a "wrapper" script that calls a more advanced script that is written in Perl or Python, unless all you want to do is some basic system stuff. There are AppleScript gurus who will disagree with this, and they are probably geniuses who can make AS do what they want -- but I prefer the more pithy (hah a pun) syntax of Python to the sentences of AppleScript.
Python support in OS X -- well, OS X is Unix, so you just grab the source and compile it (it's a piece of cake) and now you have Python. Since OS X does not have the Tk or certain other windowing toolkits built-in, you should probably use Fink to install X11 onto your Mac and then you can use the Tk toolkits (and other graphical toolkits like Gtk and that TrollTech one I forget what it's called) to build GUI apps. Of course, I think that it's supposed to be relatively easy to build a Cocoa wrapper around a Perl script in the next version of OS X (10.2), so perhaps a Python one will be forthcoming as well.
To answer your final question, I purchased that book but it was written in OS X's infancy (10.0.x) and barely covers OS X. I'd wait for a new edition for that one, since really AS is not very different between OS9 and OS X. But that book has a lot more content for applications that exist in OS 9.
"First you gotta do the truffle shuffle."