What is Applescript?

Brendan McGuigan

AppleScript is a scripting language built into the Macintosh operating system, developed by Apple. AppleScript also refers to the interface for writing these scripts, and it operates in parallel with the more familiar graphical user interface of OSX. It has its roots far back in Appleā€™s history, but has developed quite a bit since its early days, and has become a robust scripting language, capable of doing many things. AppleScript is one reason many so-called power users appreciate the Mac operating system, as it allows a relatively straight-forward way to write quick and dirty scripts to automate basic activities or extend the functionality of the operating system without writing full programs.

Apple developed the Applescript scripting language built into the operating systems of its Macintosh computers.
Apple developed the Applescript scripting language built into the operating systems of its Macintosh computers.

HyperCard was an early application builder created for the Mac in 1987. It offered a simple way for people to design simple programs, built on the concept of a HyperStack, a number of pages that could be linked to interact with one another via buttons or other behaviors. The program used a simple but robust scripting language, called HyperScript, which was intended to be as close to normal language as was possible, allowing non-programmers to build functional programs. Eventually Apple realized that the basic concepts that made HyperScript so accessible could be applied to any application, not just HyperCard, and so AppleScript was born.

The first version of AppleScript came out in 1993, and was bundled with the Mac System 7 Pro. For AppleScript to truly take off, it needed applications that could make use of it. QuarkXPress was one of the first programs to take advantage of the versatile scripting language, allowing it to help extend the desktop publishing applications of its software. As a result, one of the first industries where AppleScript saw widespread deployment was in publishing, where it was found to be ideal for automating complex workflows to make for more efficient layout.

When Mac OSX was released, it included a robust framework, called Cocoa. AppleScript made full use of the Cocoa framework, and as a result became even easier for beginning users to use. With AppleScript and Cocoa, users can actually build rather complex programs without knowing any advanced programming. The release of AppleScript Studio saw this become even easier, with the capability to build entire applications using a programming suite that could bypass the actual writing of any code.

One of the things that makes AppleScript so powerful is the fact that it can communicate between programs, something made possible because most programs on the Mac use roughly the same Apple Events. As a result, complex workflows can be automated by having each step done in the program it needs to be done in, with variables that can be set. This means that the user needs to run only one script to do quite ornate operations.

For example, a person could write a script to build a web-page of mp3s of their latest album, stored on their computer as uncompressed sound files. The script would run a sound editing program to equalize the levels and convert the files to mp3s. Then it would rename the song in the Finder to a standardized name. Then it would open a text editor and write a simple HTML page to display the song. Then it would open an FTP program and upload the page. Then it could move on to the next file in the directory, and in this way quickly build an entire website.

You might also Like

Discuss this Article

Post your comments
Forgot password?