# 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)

1. ALWAYS backup your project BEFORE running the script on it. You never know when a bad script will interact with your artwork.

2. All standard REXX functions and REXX libraries can be used by CWX scripts (including REXXUTIL, RXU, RXFTP, RXSOCK, VREXX and others).

3. 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.

4. 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:
   1. 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).
   2. Have it read settings from a file on the hard drive.
   3. Hardcode the parameters into the script itself
   4. 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.

Running Scripts | Index | Functions by Name