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.
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