this tutorial is continued from the Part 1 HERE.
we will now edit the script code.
*************************************
IMPORTANT NOTES BELOW - READ BEFORE BEGINNING
NOTE * NOTE *NOTE * NOTE * NOTE * NOTE *NOTE * NOTE * NOTE * NOTE *NOTE * NOTE *
when you write a new script and save the recording, it will always save the script into whatever
folder you choose. mine is set to save to the Scripts-Restricted folder under My PSP Files.
do not delete anything if you don't have to, you might delete something you weren't supposed to.
the indentation before the commands are important, make sure they are left alone.
a couple other things, if you just skim through the script code, you can see the different commands.
its pretty explanatory on which command does what.
the only thing that gets confusing is the layer selection code. it doesnt tell you TEXT layer, instead
it says +2 or -6, it counts how many layers you skipped up or down from the layer you were on when
you selected the new layer. hope I explained that ok.
NOTE * NOTE *NOTE * NOTE * NOTE * NOTE *NOTE * NOTE * NOTE * NOTE *NOTE * NOTE *
locate the script and move it to the LKD_ScriptTutorial folder we created in the beginning.
now in the selections folder of My PSP Files, locate and move the selections into the Script Tutorial folder.
now in the Script Tutorial Folder, right click on the script file and open with Notepad.
you should see something like the following, click for larger preview:
the PSPApp highlighted in yellow needs to be changed to JascApp.
the 12.50 highlighted in pink needs to be removed.
ONLY THE 12.50, do not delete the apostrophes before and after the numbers.
the numbers tell you what version the script was written in.
you delete it so the script can be run in any version PSP.
if you want to include a message before the script begins, you will need to insert the following code BEFORE
the # FileNew command:
####User Alert####
result = App.Do(Environment,'MsgBox',{
'Buttons':App.Constants.MsgButtons.OK,
'Icon':App.Constants.MsgIcons.Info,
'Text':'This is a paid script. Do not share.\n'
'Please make sure to read my Terms of Use.',
})
####End User Alert####
you can change the part highlighted in red, that will be your message. do not change the other coding.
and insert it like so in this image, click for larger preview:
remember the spacing is important, there is a single space in between the command before and after.
there is no indentation on that code so dont worry about that for now.
*************************************
now move onto the first fill command.
scroll down and you should see something like this, click for larger preview:
I can distinguish where to put my message into by the NEW RASTER LAYER command
and see the layer title highlighted in green.
below that command, you see the fill command. we are going to put in a message
before that command so the window pops up to tell the user to select a color.
the portion highlighted in red is what we will change.
now copy the code below to insert in the line below the NEW RASTER LAYER command and before the FILL
command. You write whatever message you want in the highlighted red part.
# ButtonTypes = ( 'OK/Yes' )
App.Do( Environment, 'MsgBox', {
'Buttons': App.Constants.MsgButtons.OK,
'Icon': App.Constants.MsgIcons.Info,
'Text': 'select a color for the TEXT layer',
})
Material1 = App.Do(Environment,'GetMaterial',{
'IsPrimary':App.Constants.Boolean.true,
'GeneralSettings': {
'ExecutionMode':App.Constants.ExecutionMode.Interactive
}
})
now copy this code to replace the blue highlighted portion from the previous image.
Material1,
Material1 is your color/materials palette.
if you pasted it correct, you should have something like below, click for larger preview:
for this tutorial, find the remaining 4 layers and repeat the steps we just did.
to alert the user that the script is complete, you can paste the USER ALERT code (that we used in the beginning),
you paste it at the very end of the coding.
and you're done. try running your edited script to see if it works for you.
*************************************
it looks complicated but do it several times and you get the hang of it pretty quick.
if you want to use a highlight layer that the user can't change, #fffff (white) for instance,
just use white when you write the script and dont change the coding.
that way, the script is written with that color/setting.
theres so much that can be done so just keep playing with it and get the hang of it!
I recommend this blog HERE for some awesome tutorials and pretty much alot of know-how.
thanks so much for visiting and I hope to have helped you! :)