Skip to the page
Tutorial areas

Run a script from a script palette

Double-click a script in a script palette to run it on the open drawing, and undo everything it drew in one step.

How-toBeginner2 minMenu: Window › Script Palettes

Once a script is in a script palette, running it takes one double-click. The script runs on the drawing that is open, and what it draws is one undo step. This page uses the palette from Keep scripts in a palette for one-click use, which has the script Four Rectangles.

Steps

  1. Find Four Rectangles in the Script Palettes palette, under the name of its palette, Drawing Helpers. The Py before it means a Python script.

    The Script Palettes palette with Four Rectangles picked out under Drawing Helpers
  2. Double-click Four Rectangles. The script runs on the open drawing, and four rectangles appear in a row. The first run may take a little longer, while Python loads.

    The drawing with four rectangles in a row, drawn by the script
  3. Press ⌘Z. All four rectangles go in one step.

Tips

  • Select the script's row and press Enter to run it without the mouse.
  • Right-click the script and choose Run to do the same from the menu.
  • If the script fails, an alert shows the line that went wrong. The drawing is not changed by a script that fails.

Limits