With the System 7.5 operating system, Apple now builds in its AppleScript scripting technology to let users automate routine or complex tasks �? offering the broadest range of scripting options available.
Using AppleScript's "Watch Me" feature in supported applications, you can automate any series of actions �? such as reformatting a document or recalculating a spreadsheet. You can also use scripting to easily build custom solutions by combining the most useful features of several applications �? for instance, a word processing program could be scripted to automatically retrieve information from a customer database and an accounts payable module to generate a dunning letter.
As of early 1994, 80 software developers have announced support for AppleScript, including Microsoft, Claris, Aldus, ACIUS, Deneba, Great Plains, Symantec, WordPerfect, Alladin Systems, CE Software, and UserLand. By providing "scriptability," their applications can be linked to each other �?- and with the Macintosh Finder �?- via scripts.
Scripting Desktop Functions
---------------------------
With System 7.5, the Finder also becomes "scriptable", meaning that you can now automate system tasks with your scripts. The Scriptable Finder provides full Object Support Library support to the Macintosh Finder, letting the Finder be scripted and recorded. For instance, using AppleScript and the desktop functions of the Finder, you could create a script that backs up a hard disk onto a server. Taking advantage of the Scriptable Finder, you could also create a script that sets up a File Sharing "drop" folder, automatically enabling File Sharing, specifying privileges, and creating a folder that can be shared.
Using AppleScript to script the Finder along with scriptable applications, you could automate the process of updating a weekly report. The script could retrieve and open the report template from a departmental server and then go onto the administrator's hard disk and open the most recent budget spreadsheet, selecting this month's figures and copying them directly into the report.
The script could then enter today's date in the report, open the PowerTalk "mailer" attached to the report document, identify people on several different mail services to whom it should be sent, and send it. Once sent, the script can do a "Save As" and name the report with the current date, saving it in an archive folder on the server.
Improvements Over Previous Finder/AppleScript Capabilities
----------------------------------------------------------
The Finder Event Suite provided with the 7.0 Finder is inadequate for all but the most basic of scripting needs. Providing a Scriptable Finder is the most compelling thing that Apple could do to leverage the power of AppleScript and speech-recognition software.
Components of the Scriptable Finder
-----------------------------------
The following are components of the Scriptable Finder:
* Full scriptability and recordability of all Finder functions. You can write
scripts to do anything that can be accomplished using the standard
point-and-click interface currently supported by the Finder. You create
sample scripts by turning on recording and using the standard point-and-click
interface.
* The Shutdown Items folder found in the System Folder. Items in this
folder are automatically run when the system is restarted or shutdown.
You may place a custom script in this folder and have it run whenever you
shut down your Macintosh. For example, if you have scripts in the
Startup Items folder that logs onto servers, creates folders, and copies
files, your "Shutdown" scripts could archive these folders and delete
them from your desktop.
* Through scripting, the Finder can provide services to third-party
applications.
Events and Objects Supported By the Scriptable Finder
-----------------------------------------------------
Events
In addition to supporting a variety of constructs from the Core suite, the Finder suite defines Apple events for these functions:
* Cleaning up icons
* Ejecting disks
* Emptying the Trash
* Putting away icons
* Restarting a computer
* Shutting down a computer
* Putting a Macintosh Portable or PowerBook computer into sleep mode
Objects
The following objects are supported by the Scriptable Finder:
* Finder aliases
* The Finder application
* Application files
* Containers such as folders and disks
* Windows for Finder containers
* Control panels
* Desk accessories
* The desktop
* Disks
* Document files
* Files
* Folders
* Font files
* Gestalt information
* Info windows
* Keyboard layouts
* Processes
* Script resources
* Sound files
* Suitcases
* The Trash
AppleScript first became available as part of the operating system in System 7 Pro in October, 1993. With System 7.5, AppleScript becomes available to all System 7 users.
The AppleScript Scripter's Kit
------------------------------
System 7.5 includes AppleScript enabling technology to run AppleScripts on your system. However, if you want to create your own scripts, you need to purchase the AppleScript Scripter's Kit (M1730LL/A), which includes documentation, sample programs, and a third part interface builder. The AppleScript Scripter's Kit is available where other Apple software is sold.
Article Change History:
14 Feb 1995 - Reviewed for technical accuracy.
14 Dec 1994 - Added keyword and Scripter's Kit informaiton; minor updates.
Support Information Services