Using BoundScripts - MiniTutorial



Created May 8, 2003 © Copyright SuzShook
Property of SuzShook


 
   ~   :   ~   :   ~   :   ~   :   ~   :   ~   :   ~   :   ~   :   ~   :   ~   :   ~   
 
:
Translate this page into
:
:
Spanish | French | German | Italian | Portuguese | Norwegian
:
:
Free Translation
:
 
   ~   :   ~   :   ~   :   ~   :   ~   :   ~   :   ~   :   ~   :   ~   :   ~   :   ~   
 


This tutorial is my own creation;
however, most of the techniques used in this tutorial, I have learned from others.
Therefore, if you recognize any contribution you have made, I thank you.
And I thank you as well for respecting this as my work by not posting it,
in whole or in part,
in any other location without written permission from me.

Individuals and PSP graphics groups are invited to share my tutorials with others with TEXT LINKS ONLY.
You can e-mail me to let me know you are adding one or more of my tutorials to your list if you like -
it's always fun to know who is doing them.



tips & tricks button


This tutorial will teach you how to use BoundScripts, which function essentially as commands and allow you to add scripts to toolbars and menus. It also provides the user with a script that makes managing BoundScripts an easy task. Hope this tutorial helps you make your workspace work for you.




This tutorial assumes you are a relatively new user to Paint Shop Pro, Version 8, and is written in and for that version.

Many screen shots in this tutorial are resized - your work will be larger than this.



Supplies - For this tutorial, you will need the following:

~     ~     ~     ~     ~     ~     ~     ~     ~     ~

OK, now we're ready to begin. Grab your mouse and let's get started.

Remember to save often.

~     ~     ~     ~     ~     ~     ~     ~     ~     ~


STEP 1

PSP 8 allows the use of special scripts called BoundScripts, which function essentially as commands. There are 9 of these BoundScripts available in PSP - and their names are in the format BoundScriptx, where "x" is a number from 1 to 9.

When PSP 8 is installed, blank copies of these 9 BoundScripts are created in the C:\My Documents\My PSP8 Files\Scripts-Restricted folder. These are just "placeholders" - they're yours to use if and when you need them. But there are only 9 of them, so you'll want to use them wisely. Normally, you will save a script with one of the BoundScript names, or rename an existing script to one of these names, such as BoundScript7.PspScript.

Keeping tract of which BoundScript numbers you have already used, and what each does can be a hassle, especially if you have some which are trusted and others which are restricted. And renaming your scripts to these names can be a nuisance as well.

Fortunately, there is some help in this area. Andrew Durdin created a wonderful script called ManageBoundScripts. Here are Andrew's own words describing his ManageBoundScripts script:

"It presents you with a list of BoundScripts on the left, and a list of other scripts on the right. You select a BoundScript from the first list, select a script for it to run from the second list, then either repeat the process or click OK to make the BoundScript run that script. If the BoundScript you set up has already been assigned to run another script, that script will be highlighted in the second list, so you can see how your BoundScripts are already set up. This script will then manage the process of running either trusted or restricted scripts from the BoundScripts, letting you give your attention to your real work with Paint Shop Pro."

One of the great advantages of Andrew's script is that it links the script with the BoundScript (rather than renaming it), leaving the original script intact (scripts are a lot easier to find when they have meaningful names). And you don't have to worry about moving the script from a restricted folder to a trusted folder - the ManageBoundScripts script does that for you, so there are no duplicate names.

Andrew has graciously allowed me to host his script on my site, so if you are interested in using this script, you can find it HERE. ~ ~ Unzip into your C:\My Documents\My PSP8 Files\Scripts-Trusted folder.

Note: This script must run from the trusted folder because it has its own dialogs, and edits the BoundScript files.

Whenever you need to assign a script to a BoundScript, or you just want to know which BoundScripts have been assigned, or which scripts the BoundScripts are assigned to, run the ManageBoundScripts script. Just activate the Script toolbar (View...Toolbars...Script), and click the Run Selected Script button run selected script button:

script toolbar

STEP 2

Let's take a look at the ManageBoundScripts interface. In the first example, BoundScript1 has been assigned to the "duplicate-closeoriginal" script. This script is a trusted script, as noted in the message (below the lists, boxed in red):

ManageBoundScripts interface

Here's another example - in this case, BoundScript4, highlighted in the 1st window, has not yet been assigned, as noted in the message (boxed in red):

ManageBoundScripts interface2

It could be assigned to any of the scripts in the second list, which contains all the scripts currently accessible on the system. Just scroll down through that list to find the script you want to run as BoundScript4, and press the OK button when you have it highlighted. If the script you select is trusted, BoundScript4 will be moved from the Scripts-Restricted folder to the Trusted folder and linked to the script you have chosen. When you select to run BoundScript4, it will run the script you linked it to.

Now here's the really great thing about BoundScripts - they function essentially as commands. You can add them to toolbars or menus and/or assign keyboard shortcuts to them. This is done using the Customize dialog. Search for Bound Scripts in the Categories list, and then drag the BoundScript to the toolbar or menu of your choice. You can even assign a shortcut key to the BoundScript while in the Customize dialog. For a detailed explanation on how to use Customize to add commands to menus or toolbars, visit my Customizing Toolbars in PSP 8 and my Customizing Menus in PSP 8 Tutorials!


Thank you, Andrew, for this very useful script!


If you have any problems, comments, or questions, please do not hesitate to Email me.



Email


PSP8 Tutorials ~ PSP8 Tips & Tricks ~ About Me ~ Links ~ Home ~ Email

All graphics and content © 2003 by SuzShook