O'Reilly logo

AppleScript® Programming for the Absolute Beginner by Jerry Lee Ford

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Keeping Track of Data

All but the most simple and basic AppleScripts are designed to accept, process, and manipulate data in some manner. The data may be collected from the operating system or be provided by the user. In AppleScript, variables are used to manage the storage and retrieval of data. A variable is a pointer to a location in memory where data is stored. Variables provide a means for storing data input that can be referenced and modified as necessary during script execution.

Assigning Data to Variables

The most common way of assigning a value to a variable is to use the set command. This command has the following syntax.

set
							VariableName to Value

VariableName is a placeholder representing the name of the variable to which Value

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required