Corel PaintShop Pro Sample Scripts
The following table describes the sample scripts that are available. The scripts range in
complexityfrom simple scripts that exercise a particular command to complex scripts that are
very specialized. Some sample scripts can be used as they are; other sample scripts use
hardcoded directory strings that need to be customized for your system.
Note: Please refer to the Corel PaintShop Pro Scripting Guide for detailed information about
scripting.
Sample script
Description
AddBordersAndSelect
This script executes an AddBorders
command and then selects the borders. It
does this by using GetCommandInfo to
retrieve the last used parameters of the
AddBorders command, and uses those as
input to the selection command.
DumpEXIFInfo
This script uses the ReturnImageInfo
command to send all of the EXIF data to
the script output window.
ExploreConstants
This is a Tk dialog that permits you to
browse the collection of constants defined
by PaintShop Pro. It is not a sample so
much as a utility to assist with writing
scripts.
NameThoseLayers
This script iterates the layers in the open
image and prompts for a new name for
each one. It illustrates how to iterate layers,
and access layer property data.
PrepForStitching
This script arranges the currently open
images edge to edge on a new document.
It is useful as the first step in stitching
multiple images together. As a sample it
shows how to work on multiple documents.
Corel Corporation | Corel PaintShop Pro Sample Scripts
ProcessDirectory
This is a utility script that processes all
images in a directory tree you define. The
directory name and search pattern are
defined in the script, and must be modified
to fit your local system. It then calls a
ProcessFile function for each file it opens;
this needs to be overridden to do
something useful.
TestGetMaterial
Sample script that illustrates how to use the
GetMaterial command to access the
foreground/background colors set on the
material palette.
TestGetRasterSelectionRect
Sample script that illustrates use of the
GetRasterselectionRect command to query
for information about the selection.
TestGetStringAndGetNumber
Sample script that illustrates use of the
GetString and GetNumber commands.
These commands make it simple for a script
to prompt for input without going to the
effort of writing a Tk based dialog.
TestMsgBox
Sample script that illustrates use of the
MsgBox command for displaying a message
box.
TestScriptWindowCommands
Sample script that illustrates using
commands that control the script output
window.
Corel Corporation | Corel PaintShop Pro Sample Scripts