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

How Clippings Work

image

Script Debugger comes with clippings that correspond to all the commonly used AppleScript control structures. You can also add your own clippings, to implement any boilerplate that you frequently use. The clippings are text files in ~/Library/Application Support/Script Debugger 4.5/Clippings, and you are free to add text files here.

Alternatively, you can keep clippings in the top-level /Library/Application Support/Script Debugger 4.5/Clippings. Yet a third possibility is to keep them in a folder called Clippings in the same folder as the Script Debugger application, but this option is mostly for backwards-compatibility and is not recommended.

A file will appear as a menu item. A folder will appear as a hierarchical menu, and the files inside it will be its menu items. The name of a file (or folder) is the name that will appear in the menu, except that certain names or part-names are hidden and used for determining the order of the menu, as follows:

  • If a name starts with the prefix ##), where ## is a two-digit number (00-99), these digits are used to determine the position of this item in the menu and the prefix does not appear in the menu item’s name.

  • A name ##)-*** will appear as a menu separator, again with its order determined by the two-digit number ##.

To edit a clipping:

To reveal a clipping file in the Finder:

In the Clippings inspector you can also choose Reveal in Finder from the tool menu at the upper right.

A clipping’s text is pasted literally into your script, except for the following expansion tags which are interpreted intelligently:

[[selected-lines:default text]]
This tag expands to the complete lines containing the script’s current selection. If the current selection is just an insertion point, default text is used.
[[selection:default text]]
This tag expands to the script’s current selection. If the current selection is just an insertion point, default text is used.
[[select:text]]
This tag expands to text and also selects it, ready for further typing that modifies the selection.
[[user]]
This tag expands to the user’s full name, as shown in the Accounts preference pane.
[[account]]
This tag expands to the user’s short name, as shown in the Accounts preference pane.
[[date:format]]
This tag expands to the current date and time, where format is an unquoted strftime() format string. Alternatively, just say [[date]] and a standard format (mm/dd/yy hh:mm:ss) will be used.
[[VARNAME]]
This tag expands to the VARNAME environment variable. So, for example, [[SHELL]] would be expanded to something like /bin/bash. Anything in double brackets that doesn’t match one of the preceding tag types is taken to be the name of an environment variable. If there is no matching environment variable name, the tag is left unexpanded. So, for example, [[howdy]] becomes [[howdy]].

So, for instance, consider this clipping:

[[selected-lines:]]
display dialog "[[select:howdy]]"

What does it do when pasted into your script? First, it skips past all lines containing the current selection, and inserts itself after the last of those lines, thus starting a completely new line. That new line says display dialog "howdy", and the word howdy is selected so that you can now type a replacement string inside the quotation marks.



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


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