LNS Home
Script Debugger
Download & Buy
x Explore
x Edit
x Run & Debug
x Deploy
What's New In 4.5
bullet Documentation
bullet Blog Posts
My SD Story
Software Updates
 
4.0.9 Update
3.0.9 Update
bullet 2.0.5 Update
x Free Downloads
 
XML Tools
XSLT Tools
x Property List Tools
x List & Record Tools
Register Your Copy of Script Debugger
Join the Script Debugger Mailing List
x AppleScript/ Scripting Links
Products
x Script Debugger 4.5
Site Contents
bullet Mark’s Blog
Product Registration
Bug Reporting
x Freeware
Contacting Us

SD4 Headling


image

Delimiters

image

Script Debugger provides features that help you enter, view, and select pairs of delimiters. Such delimiters are opening and closing double-quotes, parentheses, square brackets, and curly braces (and, much rarer, chevrons).

Delimiter Entry (Auto-Pairing)

Auto-pairing is a text entry feature where, when you type the first of a pair of delimiters, Script Debugger automatically enters the second of the pair for you.

Auto-pairing is turned on through an Editor preference:

  • Auto-pair delimiters ([{""}]). If checked, auto-pairing is turned on.

To test auto-pairing, make a new script and type a quotation mark. A second quotation mark is created for you, and the insertion point is positioned between them, ready for you to type the contents of a literal string.

Auto-pairing is intelligent. When you have finished typing the contents of the string, so that your insertion point is positioned up against the closing quotation mark, like this…

image

…try typing a quotation mark. Script Debugger does not enter a new closing quotation mark; it understands that the closing quotation mark you are typing is the one that already exists, and it behaves as if you had just typed that quotation mark, moving the insertion point beyond it.

Another convenient feature of auto-pairing is its behavior when text is selected. Normally, if text is selected and you type a key, the character entered by that key replaces the selected text. But if auto-pairing is turned on, then if text is selected and you type an opening delimiter, the opening and closing delimiters surround the selected text. Thus, for example, if howdy is selected and you type a quotation mark, you’ll get "howdy".

To reverse your auto-pairing preference setting momentarily, hold down the Control key as you type an opening delimiter. Thus, for example, if auto-pairing is turned off and you type Control-[, Script Debugger behaves as if auto-pairing were turned on: if there is an insertion point, Script Debugger types [] with the insertion point between them, and if text is selected, Script Debugger surrounds it with [ and ]. If auto-pairing is turned on and you type Control-[, Script Debugger enters [ just as if it were any old character.

Delimiter Checking As You Type

With this feature (independent of auto-pairing), when you type a right (closing) delimiter, Script Debugger looks backwards to make sure that it matches a corresponding left (opening) delimiter. If so, Script Debugger highlights the earlier delimiter momentarily. If not, Script Debugger beeps.

This feature is turned on through an Editor preference:

  • Auto-hilite opening ([{ when typing closing }]). If checked, this feature is turned on. Use the slider to set how much delay there should be before the opening delimiter is highlighted, and the Scroll if necessary checkbox to set whether Script Debugger should momentarily scroll backwards if needed to reveal an opening delimiter.

Delimiter Selection (Balance)

To select everything within a pair of delimiters, click or select anywhere between the delimiters and choose Edit > Balance. An Editor preference determines whether the delimiters themselves will be included in the selection:

  • Balance includes enclosing ([{ }]) delimiters. If checked, the Edit > Balance command selects everything including the surrounding delimiters; otherwise, it selects everything within the delimiters.

The Balance command also considers a comment to be delimited thing. Thus, if you choose Edit > Balance when the selection is within a single-line or multi-line comment, the entire comment will be selected.

This is actually the same feature used for block selection. If you choose Edit > Balance repeatedly, Script Debugger will select everything within delimiters, then everything within any delimiters surrounding those, and so on; then it selects the containing AppleScript code block, then the block containing that, and so on.



Explore | Edit | Run & Debug | Deploy | What's New In 4.5 | My SD Story


Copyright © 1998-2009 Late Night Software Ltd. - All Rights Reserved.