How to Write Your Own Scripts

by Sigrid, Co-Owner of EZ Tagging



Part 2 - Using the PSP Script Editor

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Editing a Script

Now let's have a look at the script we have just created:

Select the script in your script toolbar


Then click on "Edit Script"

Do you recognize the list of commands that you used while recording the script?

Before we go any further it is probably wise to make a copy of your script. After all, if you do something wrong during the editing process it's always better to have the original at hand.
Click on the "Save as..." button in the script editor and save it with a new name.
 

After clicking ok you should be back in the script editor and the title of the dialog box should show the new name of your script.

You may have noticed that some of the commands have a (NOT Editable) in their line. These can not be changed in any way in this Script Editor. But the Layer Properties command has no such remark.
So let's play around with it.

To begin with, uncheck the small box beside the command Layer Properties.
Then click on Save and Close


If you run the script now, you will notice that nothing much will happen. Only the next layer will be selected.

Like this the script is not very useful.
So lets go back to our script in the PSP-Script-Editor.


Interactive Recorded Script

Now re-check the Layer Properties command.
But how about we let the user decide how the new layer name should be? This can be easily achieved:

Click on the little arrow in the dropdown-field beside the Default

As you can see, you have three options there.
Default
Interactive
Silent
Chose Interactive like I did, click on Save and Close again and let the script run to see what happens.

Did it work?
Did the script stop and come up with the Rename Layer Dialog?

You now know an easy way to make a script interactive.
Of course it can get annoying to always have a dialog pop up during the execution of the script, especially if it is running continuously in a loop. And at the moment you have to call the script manually for every new layer.

So in the next part of this tutorial you will learn how to add an input-box and a loop for the script to run over and over again until you say stop.

But first, change the script back to how it was.
Open up the PSP-Script-Editor again and change the Interactive back to Default or even to Silent which only means that no dialog will be shown.

~~~~~~~~~~~~~~~~

Back Next

~~~~~~~~~~~~~~~~

EZ Tagging

~~~~~~~~~~~~~~~~



This tutorial was written by Sigrid
Any similarities to other tutorials is merely a coincidence.
~All rights reserved - 2012~