Why does this recording not capture a colour swap?

Moderator: Kathy_9

Post Reply
terrypin
Posts: 470
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

Why does this recording not capture a colour swap?

Post by terrypin »

I posted originally here:
viewtopic.php?f=56&t=66091

But I did eventually succeed in consistently reproducing the effect reasonably closely.

So I then attempted to record it with the following script. But it failed, not creating the second edge.

Code: Select all

from JascApp import *
# See post at https://forum.corel.com/EN/viewtopic.php?f=56&t=66091
# And then at
# Place the selection and then run the script
# BUT, unlike the manual recording, this doesn't add the black edge

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

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

    # MoveSelection
    App.Do( Environment, 'MoveSelection', {
            'Offset': (9,-8), 
            'ClearSource': App.Constants.Boolean.true, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match
                }
            })

    # DefloatSelection
    App.Do( Environment, 'DefloatSelection', {
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match
                }
            })

    # MoveSelection
    App.Do( Environment, 'MoveSelection', {
            'Offset': (-11,3), 
            'ClearSource': App.Constants.Boolean.true, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match
                }
            })

    # SelectNone
    App.Do( Environment, 'SelectNone', {
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match
                }
            })
Before spotting the cause I then tried a different method to produce the effect, simply by adding a white and black shadow. That's the more intuitive way I would do it manually. But again the recorded script failed.

I then saw that in both cases the script is not recording the important step of swapping black and white in Materials. The second script had a line containing 255, 255, 255 and changing that to 0, 0, 0 fixed it. But why did the script not capture the swap in either recording?
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
LeviFiction
Advisor
Posts: 5984
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, 9, X, XI, X2, X8,X9, 2018, 2019
Location: USA

Re: Why does this recording not capture a colour swap?

Post by LeviFiction »

Some commands just aren't recorded. Things like swapping foreground and background colors is just one of those. I believe it's because a majority of commands don't simply say "use foreground" or "use backgorund" it'll actually capture the foreground and background colors at that moment and put those specific colors into the script. So it's rare that when recording a script that swapping foreground and background colors will ever be meaningful.

It's still possible to script it, you just have to do so manually. Just add this line at the appropriate location in your steps.

Code: Select all

App.Do( Environment, 'SwapMaterials', {})
terrypin
Posts: 470
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: Why does this recording not capture a colour swap?

Post by terrypin »

Thanks, understood.

Referring back to my earlier more general question, do you know of any scripts for creating other interesting text effects?
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
Post Reply