Scripts to Download
| Script (click to download) | Description |
|---|---|
| Replaces all spaces in a modified field with non-breaking space tags. This is useful for use with post codes, for example. |
"The program allows us to save a great deal of valuable time by automatically importing images, style sheets and formatting. This allows us to be more competitive in the marketplace and therefore more successful in our business "
We have created some scripts that you might find useful. Simply download the script, un-zip it into the Scripts folder in your CatBase program folder, and then choose when you want it to run.
If you don't see a script here that does what you need, please contact us! If it's not too complicated and we feel other CatBase users might find it useful, we'll create it for free. If it is more complicated, there may be a charge for creating it. Tell us what you need!
When you are importing data into CatBase, you can choose a script to run as each record is imported or after the whole import has completed. To set this up, go to the Preferences tab on an Import Style, where you'll see the Script options:
![]() |
Choose this option if you want the script to be executed as each new or updated record is saved.
Choose this option if you want a script to execute at the end of the data import. This is handy for times when, for example, you want to do some cumulative processing or updating of related records.
Click the Select button to choose your script; if CatBase cannot find the Scripts folder, you will first be asked to select it. Then you will see a list of all the scripts in the selected folder. Double-click on the one you want to use.
Some scripts require some user-specified data - for example, a script may need to know the location of a folder that you want to copy images from or to, or it may need to know the tax rate to use in calculations. You can either type the information into the Script data area or click on the Select a folder button to choose a folder location.
You can have scripts that run both after each record is imported and after all records have been imported.
There are lots of options you can set for individual fields in the Field Properties dialogue, but if you need something special to happen when a particular field is modified you can tell CatBase to run a script. this can be handy for such tasks as replacing ordinary spaces with non-breaking spaces (useful for post codes, phone numbers, and that sort of thing); performing calculations (for example, if the Price field is modified, update the Total Price field with Price * the tax rate), and so on.
To do this, open up the Table and Field Setup window (click on the Setup button on the main window and choose Table and Field Setup). Select the appropriate Table, then double-click on the field you want to add the script to. The Field Properties dialogue opens:
![]() |
Select the Run a Script when modified check box, then click the Select button to choose the script to run.
To execute a script whenever a record is saved, open up the Table and Field Setup window (click on the Setup button on the main window and choose Table and Field Setup). Select the appropriate Table. then select the Run a script when a record is saved check box. Select the script to run and close the Table and Field Setup window. (Note that the script will only run if the record was modified.)