As importantly the support for AppleScript in the Mac system has been virtually non-existent, limiting the appeal of AppleScript unless users have other applications thay can use it with. But not for much longer. The imminent release of System 7.5, likely to be a very attractive upgrade for most Mac users, should include AppleScript together with a new Finder which works with it.
With this putting a more useful version of AppleScript into the hands of a lot more Mac users, we can expect to see it take off in the next twelve months, as more and more users learn the benefits of using it and more and more developers include it in their applications.
AppleScript's power and flexibilty comes from the applications it can work with. Using simple English-like constructs AppleScript can 'tell' applications what to do. You should be able to work out for yourself what the following do:
tell application "Finder" empty trash end tell tell application "FileMaker Pro" Duplicate Record 1 end tell tell application "StuffIt Expander" Expand "archive.sit" end tellThe power of AppleScript comes from combinations of commands for more than one application. For example the following commands:
tell application "StuffIt Expander" Expand "archive.sit" end tell tell application "Finder" move "archive.sit" to the trash empty trash end tellwill decompress and delete a compressed archive, using the same programs that you might use to do the job yourself. The formatting of the commands is part of AppleScript, which automatically formats a script when AppleScript checks it before saving or running it, making AppleScript very easy to read and work with.
set depth of monitor 1 to 8 say "Hello There !"work by using such Additions.
An Applet or Script Application is a Script hidden in an application: run the application and it runs the commands in the script. A Droplet is a script application onto which you drop files, folders or disks for it the script application to work on. These are typically very small programs, only around 5-10k in size, small enough that you can create a number of them, each to do a seperate task, without taking up much disk space.
Perhaps the quickest way to learn about AppleScript is to look at examples of scripts created by other people. Some come with AppleScript, and more can be found on the HKMUG BBS and other online services [follow this link to one of my own]. If you are seriously interested in AppleScript Apple have produced a small but comprehensive language guide, which can be picked up in most good computer bookstores.
This article first appeared in the September 1994 edition of the Hong Kong Mac User Group newsletter.
© John Blackburne, johnb@hk.super.net, 17th March 1996