Hello,
somethimes I need to do simple thing like crop or resize group of images. I use XnView mostly. But it is possible to somehow run without run PXP x2/x5 my scripts from shell for example? If possible from explorer context menu will be perfect.
Are recorded scripts executed through Python or some DLL?
Thanks.
Execute my scripts outside of PaintShop Pro
Moderator: Kathy_9
-
LeviFiction
- Advisor
- Posts: 6831
- Joined: Thu Oct 02, 2008 1:07 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: Alienware M17xR4
- processor: Intel Core i7-3630QM CPU - 2_40GH
- ram: 6 GB
- Video Card: NVIDIA GeForce GTX 660M
- sound_card: Sound Blaster Recon3Di
- Hard_Drive_Capacity: 500GB
- Corel programs: PSP: 8-2023
- Location: USA
Re: Execute my scripts outside of PaintShop Pro
Through the python DLL. Usually when embedded python into another program they all use the python.dll.
Though all of the external python library dependencies are python scripts still. So if you need an extra library it's possible to add it to installation and access it like any normal python library.
As for running the script without running PSP. No. PSP does have a "scriptlet" option which lets you create a shortcut that will auto-run a script when you drop an image onto the shortcut. Could also potentially do the same with a context menu item but you'd have to design that yourself.
However, a scriptlet still opens PSP. Also, unless you make the script save and close the image, the images will remain unsaved and open until you save and close them manually.
It is possible to program the script to save, and close the image. And if no other images are open close the program. But in all cases PSP itself will have to open.
The following is taken from the "Scripting for Script authors" PDF.
Using Scriptlets
The command line for Paint Shop Pro now supports the ability to drop images onto a shortcut (referred to as a "Scriptlet") that calls PSPX and a script to be applied to the dropped images.
The procedure for making a PSP Scriptlet is:
1. Create a desktop shortcut.
2. Right-click the shortcut icon, and choose Properties.
3. In the Shortcut tab’s Target field (shown below), enter the path for Paint Shop
Pro X#, followed by the switch /Script, and then enter the path for the desired
script you want executed against the image(s) you drop onto the shortcut.
Here is an example of what you could enter into the Target field:
"C:\Program Files (x86)\Corel\Corel PaintShop Pro X5\Corel PaintShop Pro.exe" /Script "C:\Users\<InsertYourNameHere>\My Documents\Corel PaintShop Pro\15.0\Scripts-Restricted\<ScriptName>.PspScript"
(where <InsertYourNameHere> represents your login name, and <ScriptName> represents the name of the script you want the shortcut to run.)
When you drop image files on the shortcut, Paint Shop Pro X will open and run the specified script on the files.
Scriptlet Limitations
Be aware of the following limitations when using Scriptlets:
Though all of the external python library dependencies are python scripts still. So if you need an extra library it's possible to add it to installation and access it like any normal python library.
As for running the script without running PSP. No. PSP does have a "scriptlet" option which lets you create a shortcut that will auto-run a script when you drop an image onto the shortcut. Could also potentially do the same with a context menu item but you'd have to design that yourself.
However, a scriptlet still opens PSP. Also, unless you make the script save and close the image, the images will remain unsaved and open until you save and close them manually.
It is possible to program the script to save, and close the image. And if no other images are open close the program. But in all cases PSP itself will have to open.
The following is taken from the "Scripting for Script authors" PDF.
Using Scriptlets
The command line for Paint Shop Pro now supports the ability to drop images onto a shortcut (referred to as a "Scriptlet") that calls PSPX and a script to be applied to the dropped images.
The procedure for making a PSP Scriptlet is:
1. Create a desktop shortcut.
2. Right-click the shortcut icon, and choose Properties.
3. In the Shortcut tab’s Target field (shown below), enter the path for Paint Shop
Pro X#, followed by the switch /Script, and then enter the path for the desired
script you want executed against the image(s) you drop onto the shortcut.
Here is an example of what you could enter into the Target field:
"C:\Program Files (x86)\Corel\Corel PaintShop Pro X5\Corel PaintShop Pro.exe" /Script "C:\Users\<InsertYourNameHere>\My Documents\Corel PaintShop Pro\15.0\Scripts-Restricted\<ScriptName>.PspScript"
(where <InsertYourNameHere> represents your login name, and <ScriptName> represents the name of the script you want the shortcut to run.)
When you drop image files on the shortcut, Paint Shop Pro X will open and run the specified script on the files.
Scriptlet Limitations
Be aware of the following limitations when using Scriptlets:
- Due to Microsoft Windows command line length limitations, there is a limit to the number of files you can drop on the Scriptlet. The limit is approximately 22 files if they have 8.3 format filenames, less if they have long file names.
A workaround to this limitation is to drop a folder of files onto the Scriptlet, which will open and process all of the files in the folder.
Be aware, however, that PSP will open all the files at once, and then process them. Thus if you do not want a large number of files opened all at once in PSP,
don't drop a folder containing many images onto a Scriptlet.
Folders are only processed one level deep. Folders within folders will not be processed.
The script is responsible for saving and closing the files, or you can do it manually after they've all been processed.
https://levifiction.wordpress.com/
-
Radim
- Posts: 712
- Joined: Mon Nov 01, 2010 5:54 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- ram: 4GB
- Monitor/Display Make & Model: 27 inch
Re: Execute my scripts outside of PaintShop Pro
Thank you.LeviFiction wrote: ...
"C:\Program Files (x86)\Corel\Corel PaintShop Pro X5\Corel PaintShop Pro.exe" /Script "C:\Users\<InsertYourNameHere>\My Documents\Corel PaintShop Pro\15.0\Scripts-Restricted\<ScriptName>.PspScript"
---
This is exactly I looked for. The only "bad" thing is that PSP opens. Silent mode will be perfert.
