Sucessful Script Making in X4?

Moderator: Kathy_9

Post Reply
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

Sucessful Script Making in X4?

Post by tattooedfreek77 »

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)
}
})
df
Posts: 1224
Joined: Mon Feb 08, 2010 11:21 pm
operating_system: Windows 11
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: GIGABYTE Z690 AERO G DDR4
processor: 13th Gen Intel Core i7-13700K
ram: 64gb
Video Card: RTX 3060 Ti 8gb GDRR6
Hard_Drive_Capacity: 1 Tb
Location: Washington State
Contact:

Re: Sucessful Script Making in X4?

Post by df »

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."
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
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: Sucessful Script Making in X4?

Post by LeviFiction »

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.
https://levifiction.wordpress.com/
Post Reply