NEW! PaintShop Pro 2019

Import Photoshop Custom Shapes

Moderator: Kathy_9

Import Photoshop Custom Shapes

Postby LeviFiction » Sat Jan 21, 2017 9:43 am

Script Name: Import Custom Shapes
Download Link: https://drive.google.com/open?id=0B8FlF ... 091LVZYU3c
Compatability: XI to X9 supposedly
Requirements: Place in Scripts-Trusted Folder
Description:
This script uses a GUI to let you open, view, and convert shapes from a Photoshop Custom Shape file (*.csh file) into a PSP vector on your current image or convert it to a Preset Shape that can be used on any image.

This code is a direct conversion from Javascript to Python. The code was originally developed by TonTon Pixel - you can see the original code on his GitHub - https://github.com/tajmone/Tonton-Pixel ... apes_Files

Video: https://drive.google.com/file/d/0B8FlFL ... NCMlE/view

UPDATE:
V1.0.1
I'm made some small updates and fixes to this script.
1) I've updated compatibility to work from version XI to X9. I have tested it in X1, X7, X8, and X9. So it's assumed that X2 - X6 are included in that compatibility
2) I've updated the look of the dialog to be a little more appealing. the buttons are the same size, the file textbox is disabled so people won't try to manually enter a file location
3) I've forced all commands to run silently so the execution mode toggle won't matter anymore.
4) I've added some failsafe code so if the code doesn't work it should hopefully not freeze up the program. We'll see if it works.

V1.0.2
1) Fixed naming conflicts between button instances and callable function names
Last edited by LeviFiction on Thu Jan 26, 2017 3:44 pm, edited 2 times in total.
LeviFiction
Advisor
 
Posts: 5398
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: 8, 9, X, XI, X2, X8,X9, 2018, 2019

Re: Import Photoshop Custom Shapes

Postby JoeB » Sat Jan 21, 2017 9:59 pm

Looks useful - thanks!
Regards,

JoeB
Using PSP 2019 64bit
JoeB
 
Posts: 2349
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 2019, 32 & 64-bit

Re: Import Photoshop Custom Shapes

Postby Ivan Mauger » Mon Jan 23, 2017 3:56 pm

Here are the images that didn't reach you, Levifiction.
Corel User Forum.jpg
Ivan Mauger
 
Posts: 14
Joined: Tue Jul 21, 2015 11:39 am
Location: England
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Re: Import Photoshop Custom Shapes

Postby LeviFiction » Mon Jan 23, 2017 4:05 pm

So the pop-ups are because I forgot to tell PSP to auto-run those commands silently in the script. I have an updated version that, once I'm sure it works well, will have that turned off. X9 has the default script execution mode set to silent, so that's why I didn't realize it was doing that. The current work-around is to toggle off interactive mode from the script toolbar. This will stop the vector properties dialog and the shape export dialog from popping up.

In the script output palette I can't really read that error. Could I get you to see if you can get the error again, and once you do, right-click in the script output palette and select all, then copy. And paste the result here? I need to see the full error.

Thanks
LeviFiction
Advisor
 
Posts: 5398
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: 8, 9, X, XI, X2, X8,X9, 2018, 2019

Re: Import Photoshop Custom Shapes

Postby Ivan Mauger » Mon Jan 23, 2017 5:10 pm

The only 'Mode' Button in PSPX8 is 'Execution Mode', no 'Interactive' so I clicked on that and away it went. Whether it was coincidence or not I don't know, but it worked fine. The vector properties dialog and the shape export dialog still appeared, but as it was converting the shapes I didn't care. Mind you, as you said there were hundreds of the geometric shapes I'll wait till tomorrow to try them. Many thanks for your patience and help, it's appreciated.
Ivan Mauger
 
Posts: 14
Joined: Tue Jul 21, 2015 11:39 am
Location: England
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Re: Import Photoshop Custom Shapes

Postby JoeB » Mon Jan 23, 2017 10:46 pm

Ivan Mauger wrote:The only 'Mode' Button in PSPX8 is 'Execution Mode', no 'Interactive' so I clicked on that and away it went.


The Execution Mode button is a toggle. Each time it is clicked it switches between Interactive and Silent modes.
Regards,

JoeB
Using PSP 2019 64bit
JoeB
 
Posts: 2349
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 2019, 32 & 64-bit

Re: Import Photoshop Custom Shapes

Postby LeviFiction » Tue Jan 24, 2017 6:19 am

Updated the script, very little difference. Mostly cosmetic. But also, hopefully, removing the issues Ivan noticed. And increasing compatibility with older versions of PSP.
LeviFiction
Advisor
 
Posts: 5398
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: 8, 9, X, XI, X2, X8,X9, 2018, 2019

Re: Import Photoshop Custom Shapes

Postby Ivan Mauger » Thu Jan 26, 2017 12:20 pm

The updated version doesn't like 'Convert All', the script output text is below. The red text, as I'm sure you know, is as it appears in script output. It's the same with the old version, although both versions convert individual shapes ok.

script output.

Executing RunScript
Executing ReturnLayerProperties
Executing StartForeignWindow
Executing StartForeignWindow

Script 'ImportCustomShapes' has completed successfully.

Executing RunScript
Executing ReturnLayerProperties
Executing StartForeignWindow
Executing StartForeignWindow

Script 'ImportCustomShapes' has completed successfully.

Executing RunScript
Executing ReturnLayerProperties
Executing StartForeignWindow
Executing AddGroupsAndObjects
Executing NodeEditSelectAll
Executing NodeEditDelete
Executing NodeEditAddPath
Executing Vector Properties
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files\Corel\Corel PaintShop Pro X8 (64-bit)\Python Libraries\lib\lib-tk\Tkinter.py", line 1470, in __call__
return self.func(*args)
File "<string>", line 77, in convertall
AttributeError: Button instance has no __call__ method

Executing ClearSelection
Executing StartForeignWindow

Script 'ImportCustomShapes' has completed successfully.
Ivan Mauger
 
Posts: 14
Joined: Tue Jul 21, 2015 11:39 am
Location: England
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Re: Import Photoshop Custom Shapes

Postby LeviFiction » Thu Jan 26, 2017 3:44 pm

Just uploaded a new version, should fix that issue.
LeviFiction
Advisor
 
Posts: 5398
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: 8, 9, X, XI, X2, X8,X9, 2018, 2019

Re: Import Photoshop Custom Shapes

Postby Elchinator » Tue Jan 09, 2018 8:38 pm

Hey, great script! It just saved me A LOT of work! Thank you!
Elchinator
 
Posts: 14
Joined: Fri Sep 23, 2016 10:53 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit

Re: Import Photoshop Custom Shapes

Postby sue » Fri Apr 20, 2018 8:11 am

Thank you for this script.

Sorry I am not used to saving scripts and so I don't know how to save it could somebody be so kind as to tell me how to do it please.

Thank you for any help
sue
 
Posts: 3
Joined: Fri Apr 20, 2018 7:58 am
Location: England
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: Jasc psp9 Corel X2 Corel 2018

Re: Import Photoshop Custom Shapes

Postby LeviFiction » Fri Apr 20, 2018 4:41 pm

Luckily it's very simple.

A script is a text file containing special code to perform actions inside PSP. All it takes to install a script is to copy this text file into the appropriate folder on your harddrive. The Import Photoshop Custom Shapes script is downloaded as a zipped archive folder. When you open this folder you'll see the file you need to copy.

PSP has two scripts folders:

Scripts - Restricted which is where you install most normal scripts. These are scripts that don't need special access to your computer.

and

Scripts - Trusted - which is where you install scripts that need more advanced functionality. Import Photoshop Custom Shapes needs to be able to files into PSP and use special libraries. So you'll be installing this script in the scripts-trusted folder.

To find out where your copy of PaintShop Pro has these folders simply open PaintShop Pro, then go to File -> Preferences -> File Locations.

A dialog will open up with all of the different resources on the left, and the folder locations where PSP looks for those resources on the right. So click on 'Scripts-Trusted' in the list on the left. Then you'll see the two locations that PSP looks for trusted scripts. ONe will be in Program Files. The other will be in your documents folder. Usually, it's stored somewhere like C:\users\YourUserName\Documents\Corel PaintShop Pro\2018\Scripts-Trusted.

Once you know where you need to save the file, go ahead and copy the PspScript file from the zip folder into your scripts-trusted folder. Once it's in there, you can run the script from the script-toolbar.

Corel made a video tutorial for installing and running scripts - https://learn.corel.com/tutorials/how-to-use-scripts/
LeviFiction
Advisor
 
Posts: 5398
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: 8, 9, X, XI, X2, X8,X9, 2018, 2019

Re: Import Photoshop Custom Shapes

Postby sue » Fri Apr 20, 2018 7:22 pm

Hi LeviFiction thank you for explaining the script to me I have not done much with them before so it was interesting to get to know about how it works.

The other problem is how I get the file downloaded I tried clicking the Download Link: https://drive.google.com/open?id=0B8FlF ... 091LVZYU3c
I coppied it to a notepad and saved it as a PspScript file but that didnt work.
sue
 
Posts: 3
Joined: Fri Apr 20, 2018 7:58 am
Location: England
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: Jasc psp9 Corel X2 Corel 2018

Re: Import Photoshop Custom Shapes

Postby LeviFiction » Fri Apr 20, 2018 8:23 pm

I'm not sure what you mean when you say you copied it over to notepad and saved it as a pspscript. That would never work. The file that is downloaded is a zipped archive folder. When you open this kind of file it opens in whatever program is setup to open .zip files. With Windows 10 the regular folder view will open. Inside that folder you'll find the ImportCustomShapes.Pspscript. You don't need notepad, you don't need to save anything. You just drag and drop the file from the archive into your scripts-trusted folder.

Here's a video demonstrating the process

https://drive.google.com/file/d/1S98TT_ ... XFr_Z/view

In this video I'm using a program called 7-zip but you don't need to use this. It's simply the program I have installed on my computer. The zip file will open just fine in regular Windows.
LeviFiction
Advisor
 
Posts: 5398
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: 8, 9, X, XI, X2, X8,X9, 2018, 2019

Re: Import Photoshop Custom Shapes

Postby JoeB » Fri Apr 20, 2018 11:42 pm

sue wrote:The other problem is how I get the file downloaded I tried clicking the Download Link: https://drive.google.com/open?id=0B8FlF ... 091LVZYU3c
I coppied it to a notepad and saved it as a PspScript file but that didnt work.


I think you may have misunderstood how to download the zip file containing the script, and suspect that you copied the gobbledygook text that appears on that page and thought that was the script. I don't know what that stuff is but it's not the script.

If you go to the download page again and look at the top right hand side you'll see some icons. One of them is a downward pointing arrow with a line underneath it. Click on that icon, because that is how to start the download. That should give you a prompt asking what you want to do with the file - i.e., save, save as, or run. Choose Save As and then browse to a folder where you would like to save the zip file and open that folder and save the zip file. Then, with Windows Explorer, go to that folder and right click on it and you should get a menu allowing you to unzip it. Or double click the zip file and you might get a program opened that will allow you to unzip it. The script is zipped within that zip file.
Regards,

JoeB
Using PSP 2019 64bit
JoeB
 
Posts: 2349
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 2019, 32 & 64-bit

Next

Return to PSP Scripting

Who is online

Users browsing this forum: No registered users and 1 guest