What does it do?
AppleScript is a plain-language programming system built into the Mac OS (from 7.5), which allows you to control applications, including the Finder, by sending them commands.Scripting lets you automate tasks which you need to repeat, and link different programs together to perform co-ordinated tasks and make life easier. It’s at once a way of creating ‘macros’ which are almost independent of the software being controlled, and a superb integrative tool.

How does it work?
Scripts are converted into a series of messages called Apple Events. Your script’s Apple Events are sent to the Mac OS, which then routes them to the correct destination application. The receiving application responds in much the same way that it responds to its own internal menu commands. A reply is passed back to the Mac OS, and finally to your AppleScript. Different applications support different scripting commands, described and documented in the AppleScript dictionary (part of the application itself), which can be opened with the AppleScript Script Editor. Some applications are not just ‘scriptable’ but are also ‘recordable’. This allows you to step through a task with the Script Editor, automatically recording the scripting commands necessary to perform that task. You can then edit and repeat the recorded script.

What can go wrong with it?
Although close to plain English, AppleScript is a sophisticated programming language. Errors can result from many causes: a language problem (‘syntax error’), picked up by the Script Editor when it checks and compiles the script; commands or objects not supported by the target program (it checks its dictionary again); problems with the target program (not enough memory, and so on). Some applications still only support the minimum ‘required’ suite of four commands, which makes them unscriptable.

How can I upgrade it?
It’s upgraded as part of the Mac OS. Third-party tools to assist scripting can be helpful, and include example scripts, debuggers (to track errors), up to FaceSpan, a complete development environment which lets you create standalone applications with AppleScript. These are supported by their respective vendors.

Further info
Web sites worth visiting include: comprehensive resource www.AppleScriptSourcebook.com/home.html ­ the AppleScript SourceBook; and www.macadillo. com/atw/ ­ AppleScript This Week, news and more from Russ Coffman.

16/02
Parameter memory

16/03
Local area networking

16/04
SCSI and FireWire

16/05
Internet Connectivity

16/06
Internal expansion buses

16/07
A/V input and output

16/08
Apple Menu, Launcher and Control Strip

16/09
AppleScript & automation

16/10
CD-ROM, DVD and CD-R

16/11
Assistance

16/12
Monitors

16/13
System Folder

16/14
Random Access Memory

16/15
The Finder

16/16
Hard disk

16/17
Control Panels

16/18
CPU

16/19
Extensions

16/20
Video chipset and VRAM

16/21
Fonts and ATM

16/22
USB and its predecessors

16/23
Printing support

16/24
Network port

16/25
Multimedia extensions