TextEdit Icon

Using Scripts

PublishPlot is a scriptable application, which allows you create many new features for working with your plots or processing data in your plots. This help topic explains how to use scripts. See the help on Writing Scripts to learn how to write your own scripts to create custom features. If you are not a programmer, see below to learn about some scripts available for downloading.

TextEdit Icon

Scripts Menu

Although scripts can be run from scripting software (such as Apple's Script Editor), it is more convenient to let PublishPlot run scripts for you. To enable this option, select a scripts folder and store your scripts within that folder (or within subfolders within that folder). Each script in that folder will be a new "feature" in PublishPlot that can be used by choosing it (by name) from the "Scripts" menu.

The "Scripts" menu is activated and used as follows:

Two Sample Scripts

When you first link to a scripts folder, or change to link to a new folder, PublishPlot will copy two sample scripts into that new folder:

  1. Sample Plot - this script demonstrates how to create a plot and add it to the front window (or a new window if needed). It is the same script explained in the help on writing scripts.
  2. Integrate Plot - this script numerically integrates the selected plot (or front-most plot if none selected) in the front window. It demonstrates doing calculations on an existing plot in a PublishPlot document.

Note that if the new scripts folder already has these scripts, the ones in that folder will be left intact and copying of these examples will be skipped. See the next section to learn how to populate the "Scripts" menu with more scripts.

Assigning Keyboard Equivalents to Scripts Menu Commands

The commands in the "Scripts" menu can be assigned to an option-command keyboard equivalent by editing the script as follows:

  1. Choose "Reveal Scripts in Finder" to show your scripts in a Finder window.
  2. Open (by doubling clicking) any script in Apple's Script Editor.
  3. Make the first line of the script begin in "-- optionKey:k" (case sensitive) where "k" is the desired keyboard equivalent.
  4. Save the script, but note the script must be saved with extension .applescript and not .scpt. If you have a .scpt file, you can duplicate it and save as an .applescript file by choosing "Text" for its "File Format" when saving in Script Editor. Once converted, you can delete the prior .scpt version.

Note that using a lower case letter will result in option-commmand-key keyboard equivalent while using a upper case letter will result in shift-option-command-key keyboard equivalent. You have to be sure to choose unique keys for you scripts (any duplicates will be ignored). You also have to avoid key combinations hogged by the MacOS (for example option-command-D shows and hides the Dock and therefore cannot be used for a script).

TextEdit Icon

Obtaining Scripts

Writing Scripts

If you are proficient at writing AppleScripts (or willing to learn), writing you own scripts is a powerful option for adding new features to PublishPlot. If you find yourself repeating the same actions over and over again, it might be time to write a script to automate all those actions. All the information you need to write scripts is provided in the Writing Scripts help topic.

Downloading Scripts

If you are not a programmer, you can still make using of scripting options by downloading and installing scripts available on the PublishPlot web site.