Writing REXX Scripts
There are a number of things to keep in mind when creating REXX
Scripts for use in Photo>Graphics.
Since Photo>Graphics Scripts can only run within the executing
Photo>Graphics application they have been given the file extension
.CWX. This is to keep the user from confusing them with regular Rexx
command files that use .CMD as the extension.
(CWX is for ColorWave rexX, ColorWave being the graphics engine inside Photo>Graphics)
- ALWAYS backup your project BEFORE running the script on it. You
never know when a bad script will interact with your artwork.
- All standard REXX functions and REXX libraries can be used by CWX scripts (including REXXUTIL, RXU, RXFTP,
RXSOCK, VREXX and others).
- CWX scripts don't have the typical REXX requirement of starting REXX files with /* */ but it's still a good
idea. At least add them with a comment saying what this script does.
- Passing Parameters to scripts is not as simple as we would like it to be.
For the time being there are only 4 ways (that we can think of) to
pass parameters to a script:
- Have it read the information from a graphic object. You can use
the Object Name of an object or the Caption from a TEXT
object as a method for passing information.
(see CALENDAR.CWX as an example of this).
- Have it read settings from a file on the hard drive.
- Hardcode the parameters into the script itself
- Start the script when Photo>Graphics PRO starts and pass parameters on the command line.
This is a deficiency we will fix in an upcoming refresh.
You may create a script in any text editor (such as E.EXE or EPM.EXE) or you
may use the EDIT SCRIPT... dialog to create, save, load or run your
scripts. This dialog is particularly useful for creating a script as it
keeps you within Photo>Graphics PRO allowing you to RUN the
script from within the editor.
Please see the SAMPLES at the end of this manual.