In addition to viewing values in an outliner, you can edit those values, and use those values to help edit a script.
In an outliner, a scalar property value is writeable, and can be changed — unless it is badged with the crossed-out pencil icon () indicating that it is not writeable.
Be careful! When you change the value of a property ultimately belonging to an application, you are changing real world facts about that application in real time. For example, if you change the value of the
name
property of adocument file
object belonging to the Finder, you change the actual name of an actual file.On the other hand, when you’re debugging a script and you use this feature to alter a value belonging to the script (such as a variable), this feature is harmless and extremely useful.
To edit a simple scalar value (a string or number):
The entry in the Value column will become editable. When you’re done:
If a value is an editable enumeration, it is represented as a pop-up menu listing the possible enumerator values. To edit the value:
A line of an outliner represents a reference to an element or property (or a variable). You can capture this reference as AppleScript code, to use it in a script. To turn a line of an outliner into a reference:
Control-click a line of the outline, and choose Paste Tell from the contextual menu. A reference to that object is pasted into the frontmost script. Hold Option to paste into a new script.
Or, drag-and-drop the line from the outliner into a script window.
Or, in a dictionary window, select the line; then press the Paste Tell button in the toolbar, or choose Dictionary > Paste Tell XXX (where “XXX” is the name of the application). Hold Option to create and paste into a new script window.
Select the line and choose Edit > Copy. Then paste wherever you want the reference to go.
Or, choose Copy Reference from the contextual menu. Then paste wherever you want the reference to go.
A line of an outliner also represents the value of whatever it is a reference to. You can capture this value. To turn a line of an outliner into a value:
Select the line, hold Shift, and choose Edit > Copy Value. Then paste wherever you want the value to go.
Or, choose Copy Value from the contextual menu. Then paste wherever you want the value to go.