« Macworld New York 2002 Not the Keynote | Main | Journaling »

The State of AppleScript

created 24 Sept. 2001


The state of AppleScript


Well, in a nutshell, it's pretty inconsistent, which ends up equating to bad.


AppleScript is one of the most critical technologies on the Mac platform, and yet unlike some other high profile technologies, like WebObjects, Apple seems to be quite divided on AppleScript. I tend to look at this as "Good Apple" and "Bad Apple".



Good Apple trots Sal Soghoian, the AppleScript Product Manager out on stage, does AppleScript demos, brings back features like folder actions, and allows them to work on closed folders, making them far more useful than they ever were in 9.



Bad Apple keeps AppleScript out of some of Apple's biggest applications, and doesn't give the core AppleScript team nearly enough support in making sure that AppleScript is omnipresent throughout Apple's product line, and indeed, has certain product team members pooh-pooh the idea, as when i talked to Final Cut Pro folks about this at Mac World Expo, and was told, "You can't script the creative process." This is a really odd thing to say when talking about a product that lists, as a feature:




"Create custom FXScript plug-in filters and transitions using the FXBuilder scripting language."


in the Compositing and effects section of the Tech Specs Final Cut Pro page. So you can script plugin creation, which, when you realize that many plugins are created to simplify certain actions, is, in essence, scripting the creative process. Contrast this with Media 100, who not only views automation as a valuable technique, but views AppleScript as an excellent way to achieve this.


DVD Studio Pro is even worse, as it specifically mentions scripting as a feature...but not AppleScript. I asked the DVD Studio Pro folks about AppleScript, and got essentially the same brush off as I received from the Final Cut Pro people. Well, they are partially right, but partially wrong, and the way they are wrong is literally costing Apple money and customers.



Creativity can't be scripted, but the real world says that you will always have far more production people than creative staff. For every artiste pushing the envelope with Final Cut Pro, you are going to have ten people creating the same basic ad spot over and over again, with the only change being the film and sound clips, and a bit of the titling. That's the key word. Production. Production makes you a lot more money than creativity, and Production is very scriptable. Just ask Showtime, who use Media 100's AppleScript features to automate their production work.



It's not like this trail hasn't been blazed already. Cal Simone and Main Event Software, with PhotoScripter, a plugin for Photoshop that was not much more than a big fat AppleScript dictionary for Photoshop, and showed that there was all kinds of room for automation in the creative world. If you think about it, it's eminently logical. If your creative people aren't wasting their talents on repetitive monkey work, then they can be doing something oh....creative maybe?



Adobe obviously agrees, as every new version of their product line of late has a very thorough AppleScript implementation. (Okay, so Acrobat's scripting is really quite wretched, but that's such a bad OS X port that I'm really ignoring it until the next new version comes out.) If Adobe, and Quark, (perhaps the only time Quark has had its head on straight is with AppleScript.) can make their products scriptable, then Apple's 'creativity' excuse holds less water than a mesh bag in the desert.



An even greater refutation of this line is iDVD...which is now...scriptable. Hmm...so now a free application is a better production tool than a thousand dollar application. Just because some people still don't get it, here's a way you could make money with a scriptable Final Cut Pro and DVD Studio Pro: Video tape conversion.



Face it, VHS tape is not set up for long term storage and being played at every possible chance. it deteriorates, it loses fidelity, it just sits there and dies. In comparison, DVDs are tanks with regard to shelf life and deterioration resistance. So, if you could script Final Cut Pro, you could get a tape in from a customer, and view just enough of it to set some basic conversion parameters in Final Cut Pro. From there, you hit a script that says, "Process this tape with current parameters into a DVD Studio File with the following settings." Once that's done, DVD Studio Pro, activated by the folder action that Final Cut Pro initiated, takes that file and creates a DVD from it, or dumps it to DLT for larger tapes. The point is, you can go from VHS to DVD with very little human intervention. You can create a relatively large set of DVD templates, and use the one the customer wants, by just using a different start script. You can do all of this on a lone machine in the corner that doesn't have a human on it watching nothing happen. Since AppleScript can trap errors, you can even set up notification routines for errors, or lack thereof.


See, there's a business that you can't do on the cheap, because you can't automate production in Apple's high-end applications. They don't get it. But if iMovie gets scriptable, and I can script burns in iDVD, (one of a very few things you can't script in iDVD), I'm starting a business...


This is not the only place where Apple's split personality hurts them with regard to AppleScript. Applications like Mail, Address Book, and iCal are AppleScriptable, but the implementations are really mystifying.



For example...in the Address Book dictionary, I can set the middle name of a contact. But the Interface doesn't have a middle name field. As far as Address Book is concerned, the only difference between a work address and a home address is a text label. The same for email addresses. Yet there are distinct items for each kind of instant messaging vendor. That's right, there's more emphasis on your IM entries than where you live and how to talk to you or email you. IM's cool, but no one is IM'ing me a check. The Address Book UI allows me to import and export data, (but not as tabbed text, which is still the only reliable way to do this), but the AppleScript implementation doesn't.




iCal has no way to make an event 'all - day' other than monkeying with the start and end times. The repeat/recurrence of an event is "The iCAL string describing the event recurrence, if defined". That's clear. Microsoft Entourage has the same type of entry for recurrance, "the iCal recurrence rule", but adds a simple boolean true/false test for 'Is the event recurring at all?" The same goes for all - day events. Now, both of these are read-only via AppleScript, which is silly, but it beats iCal in at least being able to quickly check for repeat/no repeat, and all day/not all day.



iChat is not scriptable at all, yet AOL Instant Messenger has scripting terms for almost every parameter that you would use in an IM session, including file transfer, and buddy interaction. Hmm...let's see, you need to transfer a file to someone, but it's too big to email, and they need it faster than you can send it via snail mail. They have a fast connection, but are in Hong Kong, you're in New York. Seems to me that you could use Entourage's ability to run a script from a rule and the AOL AIM client so that when the person in Hong Kong was up, they send you an email with some specific subject line, which causes Entourage to kick off a script that starts up AIM, verifies the Hong Kong person is online with their AIM client, and then transfers the file via AIM. If they aren't on AIM, tell Entourage to send them an email that tells them to fire up AIM on their end, and then resend the original email. Here's the kicker...that idea took me about three minutes to cook up. This is not rocket science. It's just thinking different.



ICQ doesn't do file transfer, but has a nice dictionary for what it does do. Yahoo Messenger isn't scriptable, but it wouldn't surprise me if they figured things out before Apple does.



Mail doesn't allow for AppleScripts from rules, and isn't useful in an automation process because someone decided that a way to 'secure' Mail from malicious scripts was to require you to manually answer a dialogue before running a script. Well, that's not security at all, and all it does do is cripple Mail's usefulness here.



It's not just iApps, or artiste applications either. None of Apple's Server management tools are scriptable. We're on the third major release of Mac OS X, and the second with decent AppleScript, yet I have to manually create printers. Network settings are only settable manually or via the command line. Yet NetOctopus, and Timbuktu Pro, both from Netopia are scriptable. Intermapper can at least send emails of notifications via AppleScript. Retrospect is highly scriptable, as are almost all the other third party network management applications. Even the next version of DiskWarrior will have AppleScript capability.



So lets see...if I want the leading email AppleScript implementation, I go to...Microsoft. For creative professional applications, i go to...Adobe and Media 100. For contact management scripting, i go to...Microsoft or Power On Software. For IM client scripting, I go to...AOL. For systems management i go to...Netopia/Alsoft/Dantz/Dartware. At exactly what point other than the OS does Apple take the lead here? Oh wait...iDVD.



AppleScript isn't new. The idea isn't new. I was willing to forgive first releases of applications that Apple bought, but neither Final Cut Pro or DVD Studio Pro are 1.0 applications. There is absolutely no excuse for Address Book to not be the example of contact management scripting. The same for Mail, iChat, etc.



Apple cannot stand on stage and say "AppleScript is a critical OS technology, and then have mediocre, or non-exisitent AppleScript implementations in their own applications. This tells developers, "Oh, don't really worry about AppleScript, heaven knows we don't really care about it." Yes, I know that each application team is responsible for that product's AppleScript implementation. That's still no excuse. Everything that Apple ships needs to be fully scriptable, and the shining example of scripting for that type of product.



If Apple can't be expected to eat the AppleScript dog food, why should anyone else? Considering the number of times that AppleScript has kept Apple customers as Apple customers, that's a really silly attitude to have on Apple's part.

Categories:     Arcana, workingmac.com
Posted by John C. Welch at 21:54 | Permalink



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.
digital.forest Where Internet solutions grow

There, a PayPal Button.

 
Use this code for your Macworld tickets!
Family
The Artwork of Melissa Findley
Diane Francis @ the National Post Eric Francis @ the Calgary Sun

Apple Amazon Links
Apple Mac OS X Server 10.5 [Unlimited]

Apple Mac OS X Server 10.5 [10-Client]

Apple Mac OS X 10.5 Leopard

Apple Mac OS X 10.5 Leopard [5-User Family Pack]

Amazon Book Links
Legacy of Ashes: The History of the CIA

The Donnas: Bitchin'

Wizards at War (The Young Wizards, Book 8)

The Demon's Sermon on the Martial Arts

The Collected Stories of Arthur C. Clarke

JavaScript and Ajax for the Web, Sixth Edition

Awakening Warrior: Revolution in the Ethics of Warfare

FOB Links

Mac Web Writers

Techie Links

Review Victims