The variables pane displays the values of your script’s variables.
When you simply run a script, the variables pane displays the script’s persistent variables (top-level entities — script objects, script properties, and globals) after execution. It doesn’t show local variables, because when the script finishes executing, local variables have gone out of scope.
When you debug a script, the variables pane also displays local variables.
To see the variables pane:
Choose View > Result & Variables Tab.
Or, click Result & Variables in the toolbar.
Variables are displayed in alphabetical order, grouped into the following categories:
Inherited variables (blue background).
A script’s persistent variables include those acquired through AppleScript’s script object inheritance mechanism.
By default, a script’s parent is the AppleScript scripting component. Therefore, the variables pane will usually display this object and its variables twice — once by virtue of being the script’s parent, and again by virtue of being the global script object AppleScript
.
Top-level entities.
The variables pane is an outliner, with all that this entails. For example:
You can double-click a line of the variables pane to see that value displayed in a separate explorer window.
You can edit the value of persistent top-level entities (such as properties and globals) shown in the variables pane; you might use this feature to experiment with your script’s behavior under different initial values of your persistent entities.
You can filter the outline by showing and working with the scope bar.
To show the scope bar, Control-click in the variables pane and choose Show Scope Bar from the contextual menu.
No variables appearing? Show the scope bar and make sure you’re not filtering them all out.
Recently changed values are displayed in red.
Script Debugger preserves the value of persistent top-level entities when a script is saved and re-opened.