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

Navigate

image

Script Debugger provides convenient ways to navigate through the structure of your AppleScript code.

As AppleScript programs become larger than a few lines, it’s common practice to divide them into smaller blocks โ€” handlers and script objects. You should adopt this practice, because it allows Script Debugger to help you navigate your code.

One possibility is to navigate by jumping from handler to handler, successively. To do so:

  • Choose Search > Go to Next Handler and Search > Go to Previous Handler. These jump to the first line of successive handler definitions.

For more power, use the navigation bar. This is the rectangle at the top of the script window, to the right, above the text area. The navigation bar shows you where you are, and it also contains the table of contents popup menu, which lets you jump easily to any part of your script.

image

The above illustration shows a typical navigation bar display. 34:17 means the selection starts at line 34 of the script, and character 17 of that line. (It may look like character 15 to you, but there are two tab characters creating the indentation.) โˆ†10 means the selection is 10 characters long. The H symbol means you’re in a handler (other possibilities are S for script object, P for script property declaration, and G for global declaration). Finally, the phrase at the end sums up your position in structural terms. Here, on s's justName(s) means we’re in a script object s that contains a handler justName that takes one parameter (also called s), and we’re inside that handler.

Hold down the mouse on the navigation bar to bring up the table of contents menu.

image

The menu shows all script object and handler definition blocks, along with all script property declarations and top-level global declarations, in an intuitive hierarchical layout. (Hold down the Option key while choosing the menu to show it without the properties and globals.) The check mark shows where the selection is now. Choose an item in the menu to jump to it.

You can also insert markers into your script. A marker’s significance is that it appears in the table of contents menu, which means you can jump to it. A marker is defined as an AppleScript comment that starts with -->>. (If text substitution is turned on, this may be converted to --ยป, but that’s okay; it’s still a marker.) AppleScript ignores a marker (because it’s a comment). But Script Debugger sees it, and lets you know this with a “droplet” symbol in the gutter:

image

The text of the comment appears in the table of contents menu:

image

The order of items in the table of contents menu is determined by an Editor preference โ€” either items are sorted alphabetically (Sort menu is checked) or they appear in the same order as they appear in the script (Sort menu is unchecked). Whichever order you prefer, hold down the Shift key while choosing the menu to show it sorted the other way.

An Editor preference also causes a tooltip to appear whenever you scroll your script. This tooltip shows the line number and navigation bar entry corresponding to the first line currently visible in the script window.



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


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