Recording and saving a script

Scripts are particularly useful for tasks with many steps. Most actions you can perform in Corel PaintShop Pro are scriptable; however, be aware of the following guidelines:

Before you start recording a script, it’s a good idea to write down the specific actions you want to record. Ideally, your actions should be as efficient as possible.

Restricted and trusted scripts

The scripts in Corel PaintShop Pro are created in the Python programming language, which can unfortunately also be used to create and execute malicious scripts. Because of this potential danger, Corel PaintShop Pro includes two folders, automatically created in two locations during installation, each folder containing script files of distinct modes. These folders are

These folders reside inside the following paths:

When you create and save a script for the first time, you’re directed to save the script in the appropriate path in ...Documents\Corel PaintShop Pro\17.0. After that, you’ll be directed to save to the most recently used folder.

When the application searches for scripts, restricted scripts are searched before trusted scripts.

Here are some considerations about restricted scripts:

Commands that cannot be used in a restricted script

Some commands cannot be run from a script stored in the Scripts-Restricted folder. The table below lists a number of these commands. If you want to run a script that contains any of these commands, you must move it to the Scripts-Trusted folder.

 

File Save
File Save As
File Save Copy As
File Export GIF Optimizer
File Export PNG Optimizer
File Export JPEG Optimizer
File Preferences File Locations
File Close
File Close All
File Send
File Batch Process
File Batch Rename
File Export Image Mapper
File Export Image Slicer
File Exit
To record and save a script Back to Top

Edit workspace 

 

In the Save As dialog box, mark the Remove Undone Commands check box.
In the Save As dialog box, mark the Save Materials check box. If this check box is cleared, the current material is used with the given tool when the script is run, rather than the material that was used when the script was recorded. This option only applies to recorded actions with a tool, not with a material setting in a dialog box.
In the Save As dialog box, mark the Save Dialog Positions check box. You may not want to use this option if you intend to share the script with others. Enabling this check box not only records the dialog position, but whether the Before/After preview area is displayed, whether the dialog is maximized, and whether the Preview on Image check box is marked. You can leave these preferences up to other users of your script.
In the Save As dialog box, click Description, and type information in the Author, Copyright, and Description boxes. The information you enter is displayed when you edit the script.

Feedback
Was this page helpful? Send feedback. (Internet connection required.)


Copyright 2014 Corel Corporation. All rights reserved.