Creating a Script Execution Button

After you write a script, you can place a button on a form to execute that script. When you click the button, ChemFinder looks for a script with the corresponding name in one of three places:

  • The same directory that contains the form.
  • The ChemFinder System directory.
  • The directory containing the ChemFinder application.

The corresponding name that ChemFinder looks for is one with the first 8 characters of the button label, with all spaces replaced by underscores, and the .cfs extension.

For example, you have a script that displays a molecule's NMR spectrum named Show spectrum.cfs. You can run this script by clicking a button you create instead of choosing it from the Scripts menu. If the button label is "Show Spectrum" ChemFinder looks for the script "SHOW_SPE.CFS" and executes it to display the spectrum.

To place a button on a form:

  1. Write a script using the ChemFinder Automation Language (CAL).
  2. Click the Button tool on the Form toolbar.
  3. On the form, click and drag to draw a button.
    The Enter the Label dialog box appears.
  1. Enter a label that corresponds to the name of the script and click OK.

To run the script:

  • Click the button on the form.

2005 CambridgeSoft Corporation. All Rights Reserved. Privacy Statement
Tel  800 315-7300 / 617 588-9300     Fax  617 588-9390     Email
CambridgeSoft Corporation, 100 CambridgePark Drive, Cambridge, MA 02140 USA