Page 2 of 3

Re: Scripting Resources

Posted: Sat Jun 04, 2016 3:49 pm
by LeviFiction
Thanks for sharing Rick_R, you're absolutely on point as most of the resources provided do very little good if you don't learn the basics of python.

A full course that teaches you not just python but also the basics of programming is an immensely helpful resource. I'm adding a python training list to the initial post now.

While learning the basics it probably won't matter much if they teach Python 2.x or Python 3.x but It should be noted that PSP uses Python 2.x as its Python Engine.

For anyone who doesn't like the idea of paying to learn Python there are other resources. See top post for some I found online.

Re: Scripting Resources

Posted: Thu Feb 16, 2017 7:20 am
by cosmicDread
Hi,

I'm sharing my CB Wallpaper Script Library. It's a collection of scripts for making wallpaper. The scripts are free and have a tiny learning curve. They were started in PaintShop Pro 7, but now have been upgraded to run on PaintShop Pro X5+. It is unknown if the library will work in earlier PSP X versions. I put the script library into a package for public download:

https://spaces.hightail.com/space/t1vmf

I also made a very basic video on how-to use the CB Wallpaper Script Library. You can watch it on YouTube:

https://youtu.be/NpCuly88Sa8

Regards,
Charles Bartley :)

Re: Scripting Resources

Posted: Thu Feb 16, 2017 3:16 pm
by LeviFiction
Hello Mr. Bartley,

Thank you for sharing. For best viewing of your scripts I suggest you make a separate topic in this board just dedicated to your scripts. This topic is for resources to learn scripting in PSP so it's not where most people will go to find full scripts.

Re: Scripting Resources

Posted: Tue Feb 28, 2017 3:48 pm
by csh2000
Can anyone point me to an updated API documentation for X9 or even X8? The last one that I have is for X6. Not able to find on the Corel website.

Thank you,
Chip

Re: Scripting Resources

Posted: Tue Feb 28, 2017 5:58 pm
by LeviFiction
I've updated the main post to include the command API for version X8. I don't know of any X9 version.

Technically, if we wanted to spend the time we could use the built in functions in PSP to build our own version of the API documentation. I keep meaning to try but never seem to get around to it.

App.Constants.All() returns objects for all of the constants categories. The functions of each object are Name(), Description(), and Values(). Values returns a list of tuples in the form (name, value, description)

So for example
App.Constants.Boolean contains two values. True and False.

App.Constants.Boolean.true
App.Constants.Boolean.false

We can create the constants very easily like so

Code: Select all

for constant in App.Constants.All():
  filename = "Enumeration_" + constant.Name()+".html"
  body = "<html>"
  body += "<h2><b> Scripting API</b></h2>"
  body += "<table><tbody><tr>"
  body += "<th> Script Name: </th>"
  body += "<th> </th>"
  body += "<th> Description: </th>"
  body += "<th> Value: </th> </tr>"
  body += "<tr>"
  for v in constnat.Values()
    body += "<td>v[0]</td>"
    body += "<td>v[1]</td>"
    body += "<td>v[2]</td>"
  body += "</tr></tbody></table></html>"
file = open(filename, 'w') 
file.write(body)
file.close()
We could also do something similar with the return values of GetCommandInfo().

This will be a less complete example because it's way more involved for GetCommandInfo(). You have a list of all commands in the variable App.Commands. Then you just run GetCommandInfo() on every command name to get the information. There's an example of exploring commands....or constants....one of the two inside the Scripting For Script Authors download. It opens a Tkinter GUI with all of the commands/constants on one side and the detailed information on the other.

Code: Select all

for command in App.Commands:
  results = App.Do(Environment, 'GetCommandInfo", {'TargetCmd':command, 'ParamInfo':0}  #returns the default parameter information
  name = results['Name']
  localizedName = results['LocalName']
  library = results['Library']
  ... #code for grabbing all relevant data
  ...
  for param in results['ParameterList']:
    .... #code to print parameter info
Sadly this doesn't always work though. In some cases the information built into PSP is incomplete. For example, I ran this in X9 and the ParameterList for "GetCommandInfo" was blank.

Re: Scripting Resources

Posted: Wed Mar 01, 2017 10:40 pm
by csh2000
Thank you Levi..

Fyi... for anyone that is looking for Python training, I stumbled across this free training offered by Microsoft. I have not gone through it, but it looks like it starts from basic (no knowledge).
https://mva.microsoft.com/en-us/trainin ... ython-8360

Chip

Re: Scripting Resources

Posted: Sat Nov 25, 2017 11:27 pm
by dfkettle
Is there updated documentation for PSP 2018 (aka PSP 20.2.0.1)? Or has nothing changed?

Thanks.

Re: Scripting Resources

Posted: Mon Feb 19, 2018 10:31 pm
by Cassel
You might need to remove Suz' site from the resources as she closed it recently. I will be reuploading some of them on my site as i get them all tested against newer PSP versions.

Re: Scripting Resources

Posted: Tue Feb 20, 2018 4:42 am
by JoeB
EDITED WHAT I JUST POSTED! Thanks for updating the resources with regards to Gary Barton's scripts. And I was very pleased to see that you have some scripts posted, something of which I was unaware. I'll definitely be browsing those scripts - some to use and some to learn from! :-)

And I can see now that the Change Resolution script will be one that will be added to a toolbar. I do lots of collage-type stuff - i.e., where I have a large image with my preferred - and defaut - print resolution used for the background image and a variety of other open images that will be pasted and moved around and resized to taste on the background. Those images come in a variety of PPI settings and all need to be set to my preferred print resolution before pasting so that I can see them as they'll actually look - and print - when pasted and resized as need. This script will save me having to use the Resize dialogue on each one - just click the button. I love saving steps!

Re: Scripting Resources

Posted: Tue Feb 20, 2018 5:53 am
by LeviFiction
Glad you like the script, I just finished moving all of the ones I had here on the forums to that site. I hope to also start including some basic tutorials in the future.

Re: Scripting Resources

Posted: Tue Feb 20, 2018 7:06 pm
by JoeB
LeviFiction wrote:Glad you like the script, I just finished moving all of the ones I had here on the forums to that site. I hope to also start including some basic tutorials in the future.
That latter objective will undoubtably be well visited. As you know, basic tutorials specifically geared to Python for PSP scripting are sorely lacking, and I'm sure there are many PSP users who would welcome the opportunity to do somewhat more with scripts than simply recording - e.g., at least have a better understanding of how to properly make edits to their recorded scripts to personalize the functionality of the script.

Re: Scripting Resources

Posted: Thu Nov 22, 2018 10:14 am
by vijayhackr
These are the resource from where you can learn scripting language easily, but you don't know which is the best one without any research, You will get it from here.

Re: Scripting Resources

Posted: Sun Jan 13, 2019 1:36 am
by Cassel
For those who want a Scripting course specifically for PaintShop Pro, there is Suz' course. It is hosted on my site for her. It is not free though but worth the expense if you don't want to go in all directions with Python that might or might not be related to PSP:
http://scrapbookcampus.com/paintshop-pr ... ng-course/

Re: Scripting Resources

Posted: Mon Feb 25, 2019 3:51 am
by aditya12
Python Tutorial - Suggested by Aditya - http://welookups.com/Python/default.html

Re: Scripting Resources

Posted: Tue Apr 02, 2019 8:34 am
by dasagrivamanu
Python is super-easy to code and one of the most popular programming languages. I'm reading and learning Python from https://www.techbeamers.com/python-tuto ... p-by-step/.
While learning OOPs, I found that It supports most of the OOPs concepts but not encapsulation. Why?