Please consider a donation to the Higher Intellect project. See https://preterhuman.net/donate.php or the Donate to Higher Intellect page for more info.

AppleScript

From Higher Intellect Vintage Wiki
Jump to navigation Jump to search
Scriptover.gif

AppleScript is a scripting language you can use to make your computer automatically complete a sequence of steps. A scripting language is similar to a programming language, but easier to use. Scripting languages consist of commands and other statements, along with syntax rules so that a computer can correctly interpret the statements. For example, both Apple Color OneScanner models use AppleScript to transfer images from the OneScanner Dispatcher application to other applications, such as the included TextBridge OCR software, or other user-defined word processing, publishing, and web authoring applications.

Overview

Although many personal computer applications already have their own command or macro languages, Apple wanted a system-wide facility that would enable different applications to work with one another. The result was "Apple events," the standardized messaging vocabulary of Apple's Interapplication Communication (IAC) technology.

With Apple events, a word processing application could take on many uses. It could, for example, launch a spreadsheet application, open a certain spreadsheet, retrieve specific data, bring that data into a report, and print the report. The messages required to do this - such as "Open application," "Open document," and "Get data" - are all defined in the Apple events vocabulary.

Apple has now introduced a scripting language built on Apple events. AppleScript can transfer almost any type of information between applications, allowing users to create intelligent scripts to control Macintosh systems and applications. You don't need to write scripts yourself; the AppleScript Script Editor can track your actions and create a script for later reuse. Scripts and scripting tools are also available from independent Macintosh software vendors.

AppleScript works over a network. This allows you to place an expensive piece of software on a single machine and share it among many machines via scripts. For example, if an application requires expensive hardware or a faster CPU, you could install the application on the high-level machine, and share the application's capabilities with other machines.

AppleScript allows you to automate routine and complex tasks, as well as to customize the way applications interact with the Macintosh Finder. It makes custom application development faster and easier because off-the-shelf applications can be used as components, with AppleScript acting as the "glue" between them.

With System 7.5, the Finder and other pieces of the system are fully scriptable, allowing you to integrate system operations into your scripts. This, coupled with the increasing availability of scriptable applications, makes AppleScript a very viable option for developing custom solutions. In addition, a Shutdown Items folder has been added to the System Folder. Scripts placed in this folder are executed automatically whenever your machine is restarted or shut down.

System 7.5 also provides a number of scripts that are ready for use. You will find these in the Automated Tasks folder, which is also available via the Apple menu.

With AppleScript, you can:

  • Automate routine operations. For example, you could create a script to automatically download and sort your electronic mail at specified intervals.
  • Automate complex operations that are difficult to remember.
  • Define links between off-the-shelf programs. This lets you create the exact combination of applications you need to perform a certain task.
  • Automate repetitive system tasks. For example, you could have a script that automatically copies the contents of a working documents folder to a file server. Placing this script in the Shutdown Items folder will backup your valuable documents anytime you shut your system down without even having to think about it.
  • Create user-friendly front ends to complex applications. With scripting, any application can act as a front end to any other. For example, you could set up a forms package to act as a data-entry application for customer orders. It could retrieve customer and product information from a networked database, and automatically generate packing slips and customer letters.
  • Customize your Macintosh system to reflect individual working habits. A salesperson could tailor a commercial word-processing program to generate sales proposals, while a lawyer could customize the same package to create contracts.
  • Customize systems to meet organizational needs. For instance, an accounting package could be customized to generate a message to a department head whenever the department is in danger of exceeding its budget.

Many major applications already support AppleScript, with more expected in the near future. These include HyperCard 2.2, FileMaker Pro, MacProject Pro, MacWrite Pro, Microsoft Excel, Microsoft Word, QuarkXPress, and WordPerfect.

AppleScript is included in System 7.5 and System 7 Pro.

Documentation

See Also