NEW! PaintShop Pro 2019

Sucessful Script Making in X4?

Moderator: Kathy_9

Sucessful Script Making in X4?

Postby tattooedfreek77 » Tue May 01, 2012 12:06 am

This is just absolutely frustrating. No one from customer help will help me. So I am hoping someone here can. For some reason I can NOT write a script that will work in any other version accept for X4. As far as I can figure it comes down to one command that comes up that no other version of PSP recognizes. It happens when I go to the different layers to start the shading etc. Any help is appreciated. I have pasted the command that appears below. Thanks in advance! ANd I'm not even working with vector layers, they are ALL raster layers lol

# Vector Selection Update
App.Do( Environment, 'VectorSelectionUpdate', {
'Path': (0,2,[],False),
'Type': App.Constants.ObjectSelection.Select,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Silent,
'AutoActionMode': App.Constants.AutoActionMode.Default,
'Version': ((14,0,0),1)
}
})
tattooedfreek77
 
Posts: 1
Joined: Mon Apr 30, 2012 11:59 pm
operating_system: Windows 7 Home Premium
System_Drive: C
32bit or 64bit: 64 Bit

Re: Sucessful Script Making in X4?

Postby df » Tue May 01, 2012 1:27 am

I have both X4 and X3 installed on this computer. I recorded a script in both to see how things are acting differently.

In X4 I get what you do:
Code: Select all
    # Vector Selection Update
    App.Do( Environment, 'VectorSelectionUpdate', {
            'Path': (0,1,[],False),
            'Type': App.Constants.ObjectSelection.Select,
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Silent,
                'AutoActionMode': App.Constants.AutoActionMode.Default,
                'Version': ((14,0,0),1)
                }
            })


But in X3 I get:
Code: Select all
    # SelectLayer
    App.Do( Environment, 'SelectLayer', {
            'Path': (0,1,[],False),
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Silent,
                'AutoActionMode': App.Constants.AutoActionMode.Default,
                'Version': ((13,0,0),1)
                }
            })


All I did to get the code was
Create a new image (blank)
Create a new layer on image
Select bottom layer
Start recording, select top layer, save recording.
I didn't do anything in either remotely related to a vector of any sort, at least not that I know of.
Regards, Dan

"Smoke me a kipper, I'll be back for breakfast."
df
 
Posts: 1208
Joined: Mon Feb 08, 2010 11:21 pm
Location: Washington State
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
processor: 2.6 Ghz i7-6700HQ
ram: 16gb
Video Card: Nvidia GTX 960M
sound_card: onboard sound
Hard_Drive_Capacity: 1 Tb

Re: Sucessful Script Making in X4?

Postby LeviFiction » Tue May 01, 2012 1:29 am

This came about when X4 gained the ability to select multiple raster layers. All previous versions could only select one raster layer at a time. So essentially they just used the vector selection abilities to select raster layers. This has made it difficult for scripters. But as df's example shows you just need to use the right command for older versions.

So to make up for this you have to exchange the "VectorSelectionUpdate" method. Just change that to say "SelectLayer" instead. Should be fine.
LeviFiction
Advisor
 
Posts: 5397
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


Return to PSP Scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron