Developer --\> Technical Publications
PATH  Mac OS X Server Documentation > Making Your Applications Scriptable

Making Your Applications Scriptable

Chapter contents | Next | Book PDF

Making Your Applications Scriptable

One of the more powerful features of the Mac OS is scripting. Scripting enables average users to become power users and tap into the latent potency of their systems without having to use mouse or keyboard. For example, a script that executes when a system boots up could run a mail program, scan messages in the in box for URLs of a certain form, and then open those URLs in Web browsers.

In a scripting language such as AppleScript, users write a series of statements, each of which seems like (or at least close to) a natural sentence in a language such as English. For example,

tell application "Finder"
	activate
	set the_version to (get the version) as text
	if the_version is less than "8" then
		beep
		display dialog "This script requires Mac OS 8 which
			is notinstalled on this computer."
			buttons {"Cancel"} default button 1 with icon 0
	end if
end tell

But once the script is interpreted and run, these sentences become control structures and commands to one or more applications on the user's system (including operating-system components such as the Finder). The beauty of scripting is that, with appealing simplicity, it extends and integrates what the operating system and each scriptable application have to offer.

Scripting and Mac OS X

Default Suites

Overview of Scripting in Mac OS X

Scriptability Guidelines


Making Your Applications Scriptable

Chapter contents | Next | Book PDF