editing scripts

Moderator: Kathy_9

Post Reply
el48tel
Posts: 245
Joined: Mon May 02, 2011 10:03 am
operating_system: Windows 7 Home Premium
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Dell Inc. 0GDG8Y A00
processor: 3.00 gigahertz Intel Core i5-2320
ram: 8Gb
Video Card: NVIDIA GeForce GT 530
sound_card: NVIDIA High Definition Audio
Hard_Drive_Capacity: 2Tb
Monitor/Display Make & Model: DELL S1909WN 18.5"
Location: NW Midlands, UK

editing scripts

Post by el48tel »

I'm trying to edit a published script
I know that height and width are the properties for height and width (makes sense)

I need to know the property for pixels per inch OR does any one have a script that sets the value --- so that I can batch

Terry
wds937
Posts: 189
Joined: Mon Dec 13, 2010 8:58 pm
operating_system: Windows 7 Professional
System_Drive: C
32bit or 64bit: 32 Bit
motherboard: Dell 0HN7XN A01
processor: Intel Pentium Dual Core E5800 - 64-bit - 3.20 GHz
ram: 4 GB
Video Card: Intel G41 Express - integrated
sound_card: Realtek High Definition Audio - integrated
Hard_Drive_Capacity: 320 GB
Monitor/Display Make & Model: ASUS VS247
Location: New Orleans, LA, USA

Re: editing scripts

Post by wds937 »

Look at Resolution in the following example:

Code: Select all

    App.Do( Environment, 'Resize', {
            'AspectRatio': 1, 
            'CurrentDimensionUnits': App.Constants.UnitsOfMeasure.Percent, 
            'CurrentResolutionUnits': App.Constants.ResolutionUnits.PixelsPerIn, 
            'Height': 40, 
            'MaintainAspectRatio': True, 
            'Resample': True, 
            'ResampleType': App.Constants.ResampleType.Bicubic, 
            'ResizeAllLayers': True, 
            'Resolution': 300, 
            'Width': 40, 
            'SharpnessValue': 50, 
            'AdvancedMode': True, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match, 
                'Version': ((13,0,0),1)
                }
            })
One way you can see how a function is scripted is to start recording a script, perform the function in PSP, and then terminate/save the script. Open the resulting script in an editor, such as Notepad, and examine its contents. You can then copy/paste whatever you need into your script.
el48tel
Posts: 245
Joined: Mon May 02, 2011 10:03 am
operating_system: Windows 7 Home Premium
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Dell Inc. 0GDG8Y A00
processor: 3.00 gigahertz Intel Core i5-2320
ram: 8Gb
Video Card: NVIDIA GeForce GT 530
sound_card: NVIDIA High Definition Audio
Hard_Drive_Capacity: 2Tb
Monitor/Display Make & Model: DELL S1909WN 18.5"
Location: NW Midlands, UK

Re: editing scripts

Post by el48tel »

thanks wds937

I'll give that a try - but in the short term you've given me the answer in the exemplar script.

Who's the cutie in the photo?

Terry
wds937
Posts: 189
Joined: Mon Dec 13, 2010 8:58 pm
operating_system: Windows 7 Professional
System_Drive: C
32bit or 64bit: 32 Bit
motherboard: Dell 0HN7XN A01
processor: Intel Pentium Dual Core E5800 - 64-bit - 3.20 GHz
ram: 4 GB
Video Card: Intel G41 Express - integrated
sound_card: Realtek High Definition Audio - integrated
Hard_Drive_Capacity: 320 GB
Monitor/Display Make & Model: ASUS VS247
Location: New Orleans, LA, USA

Re: editing scripts

Post by wds937 »

Additional resources: Scripting for Script Authors and Paint Shop Pro 9.01 Scripting API at this link: http://www.jasc.com/support/kb/articles ... onents.asp

I don't remember if there are more recent versions floating around, but most of the concepts should be the same.

The photo is of our dachshund (the subject of many pictures). :)
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: editing scripts

Post by LeviFiction »

I think scripting for script authors never really changed between version 9 and 10. I think the API has a version X1 but other than added or removed commands I don't believe there is much of a difference there either. So version 9 is good enough.
https://levifiction.wordpress.com/
Post Reply