Xic provides the ability to embed a script or script reference in a label, which is executed when the user clicks on the label. These are created like any other label, but have the form
!!script [name=word] [path=path] [script text...]
The leading token in the label must be ``!!script'' to indicate that the label text is executable. This is followed by zero or more keyword/value pairs as shown, followed by the script text that will be executed. The keywords and values must be separated by `=' with no space. The value is a single token, which should be double-quoted if it contains white space. These are optional.
The keywords have the following interpretations.
Any remaining text is executed as script commands, if path is not given. For short scripts, semicolons can be used as command terminators in a single line. Otherwise, a text editor can be invoked on the label string by pressing the ``L'' (long text) button when creating the label.
Clicking on a script label will execute the script, and not select the label as with normal labels. To select a script label, hold Shift while clicking on the label, or drag over the label (area select). If a script label is selected, it will not execute when clicked on, but rather be deselected.
For example, suppose that a user has a large layout, with a small section that the user often needs to zoom into. The user can create a script label to perform the zoom operation. After zooming in, one can note the position and estimate the width of the drawing window. Then, one would create a label such as
!!script name=zoom Window(x, y, width, GetWindow())and place it somewhere convenient. The x, y, and width above of course represent the actual values (in microns). Clicking on the label will always zoom to this area.