17.11.2014 Views

ChemOffice.Com - CambridgeSoft

ChemOffice.Com - CambridgeSoft

ChemOffice.Com - CambridgeSoft

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Administrator<br />

Creating a Script<br />

To create a script:<br />

1. Create a button on a form.<br />

2. Label the button.<br />

3. Right-click and choose Edit Script.<br />

The CAL editor appears.<br />

The OK button saves the script. The Run button<br />

saves the script and runs it.<br />

To execute a script not assigned to a button:<br />

• Choose the script from the Scripts menu.<br />

NOTE: To execute a script that does not appear on the<br />

menu, use the <strong>Com</strong>mand line and enter “Call ”.<br />

Debugging a Script<br />

You can step through a script line-by-line when<br />

debugging it.<br />

4. Type in your script commands, or use the<br />

Import button to import an existing script.<br />

5. Click OK to create a new file.<br />

TIP: You can still create scripts in Notepad or another text<br />

editor if you wish. Save the file with extension .cfs in the<br />

…\ChemFinder\System subdirectory if you want the name<br />

of the script to appear on the Scripts menu.<br />

The CAL editor is a simple, resizable text-entry<br />

window. It accepts carriage returns and tabs. To<br />

copy /paste, use Ctrl+C/Ctrl+V. To undo or redo<br />

(last change only) use Ctrl+Z.<br />

The Verify button runs the script through the CAL<br />

command parser. The parser checks only that lines<br />

begin with recognized keywords, so just because a<br />

script is parsed without error does not mean it will<br />

run correctly.<br />

The Properties button displays a dialog box used<br />

to specify whether the script is to be stored in an<br />

external file or internally, and to provide a file path<br />

or script name. You can assign a script any name<br />

you like, but the name must be unique among<br />

scripts on the current form.<br />

To view a script line-by-line:<br />

1. From the Scripts menu, choose <strong>Com</strong>mand<br />

Line.<br />

The Enter CAL <strong>Com</strong>mand dialog box appears.<br />

2. Type step on and click Execute. this turns on<br />

the step mode, where each step is displayed.<br />

3. Run a CAL script by doing one of the<br />

following:<br />

If your script<br />

appears in the Scripts<br />

menu.<br />

does not appear in<br />

the Scripts menu.<br />

Then<br />

choose the appropriate<br />

script.<br />

in the Enter Script<br />

<strong>Com</strong>mand dialog box,<br />

type call and the name<br />

of your script, and then<br />

click Execute.<br />

4. Press any key except Escape to execute the<br />

command and go to the next command.<br />

As each step is encountered, it is displayed in<br />

the status line.<br />

348•Customizing ChemFinder<br />

<strong>CambridgeSoft</strong><br />

ChemFinder Automation Language (CAL)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!