|
A pervasive and characteristic feature of AppleScript code is its block structure — a Block Entry (Auto-Closing)Auto-closing is a text entry feature where, when you type Return in the opening line of a block, Script Debugger automatically creates the closing line of the block for you. Auto-closing is turned on through an Editor preference:
To test auto-closing, create a new script and type
Now you’re ready to type the content of the repeat block. This works also for lines beginning with
Block Viewing and SelectionTo clarify the block structure of your script visually, you can hover the mouse in the gutter (the area to the left of the script text). Script Debugger outlines the nested block structure, starting with the block to the right of the mouse, in successively darker shades of grey.
This feature is turned on through an Editor preference:
When this feature is turned on, you can also select a block. To do so, click the mouse in the gutter when you see the nested block structure outlined. If you click several times in rapid succession, then each click selects the next block outwards. For example, in the above illustration, clicking once would select the Block Selection (Balance)Another way to select a block is to use Script Debugger’s Balance command. To do so, choose Edit > Balance. Each time you choose Edit > Balance, Script Debugger selects the block enclosing the current selection. Thus, if you choose Edit > Balance repeatedly, you select the block enclosing the insertion point, then the block enclosing that block, then the block enclosing that block, and so on. (The Balance command starts by selecting delimited code, if the initial selection is between delimiters.)
|
|||||||||||||||||