image

How Clippings Work

image

Script Debugger provides clippings corresponding to all commonly used AppleScript control structures, and you can add your own clippings. Clippings are text files in ~/Library/Application Support/Script Debugger 5/Clippings; you are free to add text files here.

Clipping Names and Menu Order

The name of a clipping file (stripped of its file extension suffix) is the name of the clipping, and clippings appear in alphabetical order in the Clippings menu and clippings inspector. To allow modification of this order, the following rules apply:

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:

Clippings Actions

To edit a clipping:

To reveal a clipping file in the Finder:

Expansion Tags

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

[[template:text]]
This tag displays text as a placeholder. Alternatively, wrap the text in delimiters #~...~#; behind the scenes, that’s what a placeholder’s text really looks like in a script.
[[selected-lines:default text]]
This tag displays the complete lines containing the script’s current selection. If the current selection is just an insertion point in an empty line, default text is used, and is displayed as a placeholder.
[[selection:default text]]
This tag displays the script’s current selection. If the current selection is just an insertion point, default text is used, and is displayed as a placeholder.
[[select:text]]
This tag displays text also selects it.
[[user]]
This tag displays as the user’s full name, as shown in the Accounts preference pane.
[[account]]
This tag displays as the user’s short name, as shown in the Accounts preference pane.
[[organization]]
This tag displays the user’s company name, as shown in the Company field in the user’s Address Book entry. (If that field is blank, displays “MyCompanyName”.)
[[date:format]]
This tag displays 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 displays the value of 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 unchanged; for example, [[howdy]] becomes [[howdy]].