Basic script queries

Corel Paint Shop Pro

Moderator: Kathy_9

Post Reply
terrypin
Posts: 492
Joined: Tue Jun 29, 2010 9:51 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Asus Z170 Pro 4
processor: Intel Core i7 6700K 4.0GHz
ram: 32 GB
Video Card: None - uses built-in graphics
sound_card: HD onboard sound card
Hard_Drive_Capacity: 4.256 TB
Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
Location: East Grinstead UK

Basic script queries

Post by terrypin »

I'm confused about some script basics. A scripting novice, I recorded a simple script by choosing the text tool (vector) with various settings of font type, size, stroke and colour. I was able to save the recording when I had entered some text and clicked on a location.

It ran OK but was not in quite the location I wanted. So I thought I'd simply find the line in the script specifying its position and change it.

But PSP 8 seemed on the one hand to tell me it was not editable, but also allow me to click 'Text Editor' to edit it:

Image

I identified the code OK as shown. (BTW, I'm puzzled to see it apparently uses half pixels. I thought a pixel was the basic unit?)

Image

I changed it and saved with a new name but at first that didn't seem to place the text in the revised location. (I initially posted about that, but it must have been down to me because somehow I eventually got it working logically.)

So how exactly do I interpret that first screenshot please? (There are over a 100 lines in the script.) And if it is not supposed to be editable, why? And why is the text editor accessible and allows me to edit it? Also, is there some way I can specify the location of text other than by clicking the mouse?

--
Terry, East Grinstead, UK
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
Radim
Posts: 712
Joined: Mon Nov 01, 2010 5:54 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
ram: 4GB
Monitor/Display Make & Model: 27 inch

Re: Basic script queries

Post by Radim »

Please post your whole script here or somewhere like - pastebin.com.

What version of PSP and Service Pack you have, 32- or 64- bit, and Windows version?
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: Basic script queries

Post by LeviFiction »

This is easy.

The first screen shot is the basic script editor, it's meant to be easy to use for quick changes. Things that are "Editiable" can be edited directly from that dialog. When you click on the command in question, if it's editable, the "EDIT" button you see at the bottom will become available. This will pop up a dialog with the available settings to change.

In this case PSP only allows commands that use dialogs to be edited from this simple editor. Since Text is a tool and not a dialog, you cannot edit it from this simple editor. You have to edit it directly.

So that's why when you click "Text Editor" it lets you edit the command.

The command itself can be written, changed, made smart or dumb via direct editing in a text editor since all a script is is text. But it cannot be changed in the simple script editor because it doesn't have a dialog box associated with that command.

That's all "Editable" means.

---
P.S. While pixels are the smallest unit available vectors use the decimal for calculation purposes. That's why it appears that way.
https://levifiction.wordpress.com/
terrypin
Posts: 492
Joined: Tue Jun 29, 2010 9:51 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Asus Z170 Pro 4
processor: Intel Core i7 6700K 4.0GHz
ram: 32 GB
Video Card: None - uses built-in graphics
sound_card: HD onboard sound card
Hard_Drive_Capacity: 4.256 TB
Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
Location: East Grinstead UK

Re: Basic script queries

Post by terrypin »

"
LeviFiction wrote:This is easy.

The first screen shot is the basic script editor, it's meant to be easy to use for quick changes. Things that are "Editiable" can be edited directly from that dialog. When you click on the command in question, if it's editable, the "EDIT" button you see at the bottom will become available. This will pop up a dialog with the available settings to change.

In this case PSP only allows commands that use dialogs to be edited from this simple editor. Since Text is a tool and not a dialog, you cannot edit it from this simple editor. You have to edit it directly.

So that's why when you click "Text Editor" it lets you edit the command.

The command itself can be written, changed, made smart or dumb via direct editing in a text editor since all a script is is text. But it cannot be changed in the simple script editor because it doesn't have a dialog box associated with that command.

That's all "Editable" means.

---
P.S. While pixels are the smallest unit available vectors use the decimal for calculation purposes. That's why it appears that way.
Thanks, appreciate that clear explanation!

--
Terry, East Grinstead, UK
Last edited by terrypin on Fri Sep 27, 2013 10:44 pm, edited 1 time in total.
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
terrypin
Posts: 492
Joined: Tue Jun 29, 2010 9:51 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Asus Z170 Pro 4
processor: Intel Core i7 6700K 4.0GHz
ram: 32 GB
Video Card: None - uses built-in graphics
sound_card: HD onboard sound card
Hard_Drive_Capacity: 4.256 TB
Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
Location: East Grinstead UK

Re: Basic script queries

Post by terrypin »

Radim wrote:Please post your whole script here or somewhere like - pastebin.com.

Code: Select all

from JascApp import *

def ScriptProperties():
    return {
        'Author': u'Terry Pinnell',
        'Copyright': u'',
        'Description': u'',
        'Host': u'Paint Shop Pro',
        'Host Version': u'8.10'
        }

def Do(Environment):
    # EnableOptimizedScriptUndo
    App.Do( Environment, 'EnableOptimizedScriptUndo', {
            
            })

    # Text
    App.Do( Environment, 'Text', {
            'CreateAs': App.Constants.CreateAs.Vector, 
            'Segments': [{
                'WarpText': App.Constants.Boolean.false, 
                'Bold': App.Constants.Boolean.true, 
                'Leading': 100, 
                'Fill': {
                    'Color': (255,0,0), 
                    'Pattern': None, 
                    'Gradient': None, 
                    'Texture': None, 
                    'Identity': u'Material'
                    }, 
                'Font': u'Arial', 
                'LineStyle': {
                    'Name': u'', 
                    'FirstCap': (u'Butt',0.25,0.25), 
                    'LastCap': (u'Butt',0.25,0.25), 
                    'FirstSegCap': (u'',0.25), 
                    'LastSegCap': (u'',0.25), 
                    'UseSegmentCaps': App.Constants.Boolean.false, 
                    'Segments': []
                    }, 
                'LineWidth': 0, 
                'Start': (60.5,1026.5), 
                'Stroke': {
                    'Color': None, 
                    'Pattern': None, 
                    'Gradient': None, 
                    'Texture': None, 
                    'Identity': u'Material'
                    }
                },{
                'Antialias': App.Constants.Boolean.true, 
                'WarpText': App.Constants.Boolean.false, 
                'AutoKern': App.Constants.Boolean.true, 
                'Bold': App.Constants.Boolean.true, 
                'Kerning': 0, 
                'Leading': 100, 
                'Fill': {
                    'Color': (255,0,0), 
                    'Pattern': None, 
                    'Gradient': None, 
                    'Texture': None, 
                    'Identity': u'Material'
                    }, 
                'Font': u'Arial', 
                'Italic': App.Constants.Boolean.false, 
                'Join': App.Constants.JointStyle.Miter, 
                'LineStyle': {
                    'Name': u'', 
                    'FirstCap': (u'Butt',0.25,0.25), 
                    'LastCap': (u'Butt',0.25,0.25), 
                    'FirstSegCap': (u'',0.25), 
                    'LastSegCap': (u'',0.25), 
                    'UseSegmentCaps': App.Constants.Boolean.false, 
                    'Segments': []
                    }, 
                'LineWidth': 0, 
                'MiterLimit': 10, 
                'PointSize': 24, 
                'SetText': App.Constants.Justify.Left, 
                'Start': (60.5,1026.5), 
                'Strikethru': App.Constants.Boolean.false, 
                'Stroke': {
                    'Color': None, 
                    'Pattern': None, 
                    'Gradient': None, 
                    'Texture': None, 
                    'Identity': u'Material'
                    }, 
                'Underline': App.Constants.Boolean.false
                },{
                'Characters': u'My red text'
                }], 
            'SavedText': None, 
            'FinalApply': App.Constants.Boolean.false, 
            'Matrix': None, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'PreviewVisible': App.Constants.Boolean.true, 
                'AutoProof': App.Constants.Boolean.false, 
                'AutoActionMode': App.Constants.AutoActionMode.Match
                }
            })

What version of PSP and Service Pack you have, 32- or 64- bit, and Windows version?
PSP 8, latest, XP 32-bit ("But PSP 8 seemed on the one hand...")

But as you see, puzzle now resolved by LeviFiction! :)

--
Terry, East Grinstead, UK
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
Post Reply