Running Scripts

Document scripts can be executed in a variety of ways.

Running Scripts from the Resource Browser

To run a script from the Resource Browser:

1. From the Resource Browser, select the script palette containing the script to run.

2. Double-click on the script palette to open it.

Alternatively, right-click (Windows) or Ctrl-click (Mac), and select Enter from the context menu to open the palette.

3. Select the script to run. Select Resources > Run, or right-click (Windows) or Ctrl-click (Mac), and select Run from the context menu.

Alternatively, double-click the script resource to run it or drag the script resource into the drawing area.

Running Scripts from the Script Palette

To run a script from a script palette:

1. Select Window > Script Palettes and select the script palette containing the desired script.

To open the script palette from the Resource Browser, select the script palette containing the desired script, and double-click to open it, or right-click (Windows) or Ctrl-click (Mac) on the palette, and select Open from the context menu.

2. From the script palette, double-click on the script to run it.

Running Scripts from Files

Some scripts may exist as text files only, if they were created in a separate text editor program or exported from the Vectorworks program. These scripts are not available from the Resource Browser.

1. Select Tools > Plug-ins > Run Script (or File > Import > Import Script).

The Choose Script File (or Import Script Drawing Document) dialog box opens.

2. Select the desired script file and click Open to run the script.

Script Errors

If an error occurs during script execution, an alert dialog box opens.

To handle script errors:

1. From the alert dialog box, click View Error Output.

2. The Script Errors dialog box opens, displaying the nature of the error and the line(s) where the error occurred.

3. To edit the script, click Edit Script, or double-click on a script line to edit that line. The Script Editor opens for making corrections to the script.

~~~~~~~~~~~~~~~~~~~~~~~~~

Creating Scripts

Editing Scripts

Using the Resource Browser

Creating a Script Palette

Using Scripts

 

www.vectorworks.net