NEW! Corel PaintShop Pro 2018

Scripting Resources

Moderator: Kathy_9

Re: Scripting Resources

Postby LeviFiction » Sat Jun 04, 2016 3:49 pm

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.
LeviFiction
Advisor
 
Posts: 4973
Joined: Thu Oct 02, 2008 1:07 pm
Location: USA
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSP (Installed): XI, X7, X8,X9

Re: Scripting Resources

Postby cosmicDread » Thu Feb 16, 2017 7:20 am

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 :)
Last edited by cosmicDread on Thu Feb 16, 2017 10:34 pm, edited 2 times in total.
My 'theory of relativity' is that everything is related to one another because God is the common factor.
cosmicDread
 
Posts: 18
Joined: Fri Aug 26, 2016 7:10 am
Location: Lake Havasu City, Arizona
operating_system: Windows 7 Ultimate
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: ASUS Sabertooth X79 LGA 2011 Intel X79
processor: Intel Core i7-3930K
ram: 32 GB
Video Card: GeForce GTX 1060
Hard_Drive_Capacity: 5 TB
Monitor/Display Make & Model: Acer Predator X34
Corel programs: PaintShop X5, X8, X9, 2018, VS X9

Re: Scripting Resources

Postby LeviFiction » Thu Feb 16, 2017 3:16 pm

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.
LeviFiction
Advisor
 
Posts: 4973
Joined: Thu Oct 02, 2008 1:07 pm
Location: USA
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSP (Installed): XI, X7, X8,X9

Re: Scripting Resources

Postby csh2000 » Tue Feb 28, 2017 3:48 pm

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
csh2000
 
Posts: 51
Joined: Mon Mar 31, 2014 3:54 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
processor: Intel Core i7-6500U CPU 2.50GHz
ram: 12GB
Hard_Drive_Capacity: 1TB
Corel programs: PSP X9, Aftershot Pro 3, VideoStudio X9

Re: Scripting Resources

Postby LeviFiction » Tue Feb 28, 2017 5:58 pm

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.
LeviFiction
Advisor
 
Posts: 4973
Joined: Thu Oct 02, 2008 1:07 pm
Location: USA
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSP (Installed): XI, X7, X8,X9

Re: Scripting Resources

Postby csh2000 » Wed Mar 01, 2017 10:40 pm

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
csh2000
 
Posts: 51
Joined: Mon Mar 31, 2014 3:54 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
processor: Intel Core i7-6500U CPU 2.50GHz
ram: 12GB
Hard_Drive_Capacity: 1TB
Corel programs: PSP X9, Aftershot Pro 3, VideoStudio X9

Re: Scripting Resources

Postby dfkettle » Sat Nov 25, 2017 11:27 pm

Is there updated documentation for PSP 2018 (aka PSP 20.2.0.1)? Or has nothing changed?

Thanks.
dfkettle
 
Posts: 11
Joined: Sat Nov 25, 2017 11:06 pm
operating_system: Windows 7 Home Premium
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: Paint Shop Pro, Painter Essentials

Re: Scripting Resources

Postby Cassel » Mon Feb 19, 2018 10:31 pm

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.
Cassel
http://creationcassel.com/store
Specializing in PSP specific products: scripts and tubes

http://scrapbookcampus.com
for beginner and seasoned scrappers and designers
Cassel
 
Posts: 1530
Joined: Fri Oct 29, 2010 6:49 pm
Location: Canada
operating_system: Windows 7 Home Premium
System_Drive: C
32bit or 64bit: 64 Bit
ram: 8Gb
Corel programs: PSP 8 (JASC) to PSP X9

Re: Scripting Resources

Postby JoeB » Tue Feb 20, 2018 4:42 am

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!
Regards,

JoeB
Using PSP 2018 (20.2.0.1 x64)
JoeB
 
Posts: 1954
Joined: Fri Mar 28, 2008 10:04 pm
Location: Canada
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: LENOVO 4524PE4 ThinkCentre M91p
processor: 3.10 gigahertz Intel Quad Core i5-2400
ram: 8 GB
Hard_Drive_Capacity: 4.6 TB
Corel programs: PSP 9, X7 to 2018, 32 & 64-bit

Re: Scripting Resources

Postby LeviFiction » Tue Feb 20, 2018 5:53 am

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.
LeviFiction
Advisor
 
Posts: 4973
Joined: Thu Oct 02, 2008 1:07 pm
Location: USA
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSP (Installed): XI, X7, X8,X9

Re: Scripting Resources

Postby JoeB » Tue Feb 20, 2018 7:06 pm

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.
Regards,

JoeB
Using PSP 2018 (20.2.0.1 x64)
JoeB
 
Posts: 1954
Joined: Fri Mar 28, 2008 10:04 pm
Location: Canada
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: LENOVO 4524PE4 ThinkCentre M91p
processor: 3.10 gigahertz Intel Quad Core i5-2400
ram: 8 GB
Hard_Drive_Capacity: 4.6 TB
Corel programs: PSP 9, X7 to 2018, 32 & 64-bit

Previous

Return to PSP Scripting

Who is online

Users browsing this forum: No registered users and 1 guest