Cannot get this working

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

Cannot get this working

Post by terrypin »

This is so frustrating!

I had two separately recorded scripts which worked OK consistently. I was trying to simply combine them in my text editor. But after some hours I gave up because the results either wouldn't run at all or, strangely, did only the second part, ignoring the first.

Anyway, so I carefully re-recorded all the steps as one single script. It worked perfectly on the one test I did and I finally went to bed.

But on trying it again this morning it fails, giving this error:
Image

Here is the full Script Output:

Executing RunScript
Executing ColorReplacer
Executing UndoLastCmd
Executing ColorReplacerAll
Executing Magic Wand
------- Command Execution Failed -----------
Command Name: Magic Wand
Error Text: Internal program error: An invalid parameter has been passed to a function
Traceback (most recent call last):
File "C:\Docs\My PSP8 Files\Scripts-Trusted\Elevation-Edit-Combined-3.PspScript", line 98, in Do
App.Do( Environment, 'MagicWand', {
JascApp.InvalidParameterType: Invalid parameter type (parameter )


Can anyone suggest why this now fails and how to fix it please?

In brief, this is what it does:

1. Uses Colour Replacer to replace greyish dashes with green, thus removing them from the green area.
2a. Selects the green with magic wand.
2b. Expands the selection by 1 pixel, therefore now including the 1 pixel black border that I want to keep.
2c. Inverts the selection, which is therefore now the yellow, the numbers, and the remaining greyish dashes.
2d. Fills that with a new very pale blue colour.
2e. Uses Ctrl+D to remove the selection marquee.

And here is the script:

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):
# ColorReplacer
App.Do( Environment, 'ColorReplacer', {
'BrushTip': {
'BrushVariance': {
'SizeVariance': App.Constants.VarianceMethod.None,
'SizeJitter': 0,
'DensityVariance': App.Constants.VarianceMethod.None,
'DensityJitter': 0,
'RotationVariance': App.Constants.VarianceMethod.None,
'RotationJitter': 0,
'ThicknessVariance': App.Constants.VarianceMethod.None,
'ThicknessJitter': 0,
'FadeRate': 100,
'PositionJitter': 0,
'UseScaledPositionJitter': App.Constants.Boolean.false,
'ImpressionsPerStep': 1
},
'Shape': App.Constants.BrushShape.Round,
'CustomBrush': None,
'Size': 12,
'Hardness': 100,
'Density': 100,
'Rotation': 0,
'Thickness': 100,
'Step': 25
},
'Brush': {

},
'PrimaryMaterial': App.Constants.MaterialRef.Foreground,
'ForegroundMaterial': {
'Color': (189,255,184),
'Pattern': None,
'Gradient': None,
'Texture': None,
'Identity': u'Material'
},
'BackgroundMaterial': {
'Color': (128,128,128),
'Pattern': None,
'Gradient': None,
'Texture': None,
'Identity': u'Material'
},
'Stroke': [
(App.Constants.PathEntryInterpretation.Absolute,(10.5,32.5),0)
],
'Tolerance': 20,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'RandomSeed': 81631906,
'AutoActionMode': App.Constants.AutoActionMode.Match
}
})

# UndoLastCmd
App.Do( Environment, 'UndoLastCmd', {

})

# ColorReplacerAll
App.Do( Environment, 'ColorReplacerAll', {
'PrimaryMaterial': App.Constants.MaterialRef.Foreground,
'ForegroundMaterial': {
'Color': (189,255,184),
'Pattern': None,
'Gradient': None,
'Texture': None,
'Identity': u'Material'
},
'BackgroundMaterial': {
'Color': (128,128,128),
'Pattern': None,
'Gradient': None,
'Texture': None,
'Identity': u'Material'
},
'Tolerance': 20,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match
}
})

# Magic Wand
App.Do( Environment, 'MagicWand', {
'General': {
'Mode': App.Constants.SelectionOperation.Replace,
'Antialias': App.Constants.Boolean.false,
'Feather': 0,
'SampleMerged': App.Constants.Boolean.false
},
'MatchMode': App.Constants.MatchMode.RGBValue,
'Point': (831.5,479.5),
'Tolerance': 10,
'AntialiasType': App.Constants.AntialiasType.Outside,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match
}
})

# Expand Selection
App.Do( Environment, 'SelectExpand', {
'ExpandAmount': 1,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match
}
})

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

# Fill
App.Do( Environment, 'Fill', {
'BlendMode': App.Constants.BlendMode.Normal,
'MatchMode': App.Constants.MatchMode.None,
'Material': {
'Color': (235,255,253),
'Pattern': None,
'Gradient': None,
'Texture': None,
'Identity': u'Material'
},
'UseForground': App.Constants.Boolean.true,
'Opacity': 100,
'Point': (11.5,30.5),
'SampleMerged': App.Constants.Boolean.false,
'Tolerance': 20,
'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
}
})
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
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: Cannot get this working

Post by LeviFiction »

terrypin, if you place [code][/code] blocks around your script code, the forums will display it correctly. Directly pasting the code into the forum loses all formatting which is important.

So, a few things to keep in mind about Python

1) Spacing is important. The spacing must be consistent. You cannot mix Tabs and spaces when you indent, you can only use one. Doesn't matter which one, just so long as you use them consistently. I believe PSP uses spaces when it indents. You also need to match the number of spaces. So if PSP uses 4 spaces you need to use 4 spaces.

2) Every command needs to be indented once below the "def Do(Environment):" line.

If they aren't indented they are not considered part of the "Do" function. And if they aren't in the "Do" function, PSP won't run them.

I can only assume one of these two are your issue because unfortunately the forums don't keep the spacing unless the code is wrapped inside the code blocks.
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: Cannot get this working

Post by terrypin »

Thanks, sorry about forgetting that, here's the script again below, or you can downlaod it here:
https://dl.dropboxusercontent.com/u/401 ... .PspScript

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):
    # ColorReplacer
    App.Do( Environment, 'ColorReplacer', {
            'BrushTip': {
                'BrushVariance': {
                    'SizeVariance': App.Constants.VarianceMethod.None, 
                    'SizeJitter': 0, 
                    'DensityVariance': App.Constants.VarianceMethod.None, 
                    'DensityJitter': 0, 
                    'RotationVariance': App.Constants.VarianceMethod.None, 
                    'RotationJitter': 0, 
                    'ThicknessVariance': App.Constants.VarianceMethod.None, 
                    'ThicknessJitter': 0, 
                    'FadeRate': 100, 
                    'PositionJitter': 0, 
                    'UseScaledPositionJitter': App.Constants.Boolean.false, 
                    'ImpressionsPerStep': 1
                    }, 
                'Shape': App.Constants.BrushShape.Round, 
                'CustomBrush': None, 
                'Size': 12, 
                'Hardness': 100, 
                'Density': 100, 
                'Rotation': 0, 
                'Thickness': 100, 
                'Step': 25
                }, 
            'Brush': {
                
                }, 
            'PrimaryMaterial': App.Constants.MaterialRef.Foreground, 
            'ForegroundMaterial': {
                'Color': (189,255,184), 
                'Pattern': None, 
                'Gradient': None, 
                'Texture': None, 
                'Identity': u'Material'
                }, 
            'BackgroundMaterial': {
                'Color': (128,128,128), 
                'Pattern': None, 
                'Gradient': None, 
                'Texture': None, 
                'Identity': u'Material'
                }, 
            'Stroke': [
                (App.Constants.PathEntryInterpretation.Absolute,(10.5,32.5),0)
            ], 
            'Tolerance': 20, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'RandomSeed': 81631906, 
                'AutoActionMode': App.Constants.AutoActionMode.Match
                }
            })

    # UndoLastCmd
    App.Do( Environment, 'UndoLastCmd', {
            
            })

    # ColorReplacerAll
    App.Do( Environment, 'ColorReplacerAll', {
            'PrimaryMaterial': App.Constants.MaterialRef.Foreground, 
            'ForegroundMaterial': {
                'Color': (189,255,184), 
                'Pattern': None, 
                'Gradient': None, 
                'Texture': None, 
                'Identity': u'Material'
                }, 
            'BackgroundMaterial': {
                'Color': (128,128,128), 
                'Pattern': None, 
                'Gradient': None, 
                'Texture': None, 
                'Identity': u'Material'
                }, 
            'Tolerance': 20, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match
                }
            })

    # Magic Wand
    App.Do( Environment, 'MagicWand', {
            'General': {
                'Mode': App.Constants.SelectionOperation.Replace, 
                'Antialias': App.Constants.Boolean.false, 
                'Feather': 0, 
                'SampleMerged': App.Constants.Boolean.false
                }, 
            'MatchMode': App.Constants.MatchMode.RGBValue, 
            'Point': (831.5,479.5), 
            'Tolerance': 10, 
            'AntialiasType': App.Constants.AntialiasType.Outside, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match
                }
            })

    # Expand Selection
    App.Do( Environment, 'SelectExpand', {
            'ExpandAmount': 1, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match
                }
            })

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

    # Fill
    App.Do( Environment, 'Fill', {
            'BlendMode': App.Constants.BlendMode.Normal, 
            'MatchMode': App.Constants.MatchMode.None, 
            'Material': {
                'Color': (235,255,253), 
                'Pattern': None, 
                'Gradient': None, 
                'Texture': None, 
                'Identity': u'Material'
                }, 
            'UseForground': App.Constants.Boolean.true, 
            'Opacity': 100, 
            'Point': (11.5,30.5), 
            'SampleMerged': App.Constants.Boolean.false, 
            'Tolerance': 20, 
            '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
                }
            })

Turning to the points about syntax. I found an online Python syntax checker here: http://pep8online.com/
But it reports scores of errors for every script I've tried, including those built-in and those downloaded from reliable sources. And I've been using them successfully for years. So I've no motivation to correct the 103 errors it reports in this case! I've listed them anyway here in case you can spot any that really do need fixing:
https://dl.dropboxusercontent.com/u/401 ... 103618.txt

And, of course, these are recorded by PSP8, which presumably follows the correct syntax!

Much appreciate your kind help on this, thank you.

--
Terry, East Grinstead, UK
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
User avatar
gbotes
Posts: 104
Joined: Wed Sep 30, 2015 11:31 am
operating_system: Windows 7 Professional
System_Drive: C
32bit or 64bit: 64 Bit
ram: 16GB
Hard_Drive_Capacity: 500Gb
Corel programs: Paint Shop Pro X8, Aftershot 2
Location: South Africa
Contact:

Re: Cannot get this working

Post by gbotes »

I get the same error when I try this script. Not that I'm a dab hand at PSP scripting but perhaps you could let us see your two working scripts?
User avatar
gbotes
Posts: 104
Joined: Wed Sep 30, 2015 11:31 am
operating_system: Windows 7 Professional
System_Drive: C
32bit or 64bit: 64 Bit
ram: 16GB
Hard_Drive_Capacity: 500Gb
Corel programs: Paint Shop Pro X8, Aftershot 2
Location: South Africa
Contact:

Re: Cannot get this working

Post by gbotes »

OK, hold on. Following LeviFiction's suggestion and downloading your BMP image, this script worked for me. Does it work for you and do what you need?

Code: Select all

from JascApp import *

def ScriptProperties():
    return {
        'Author': u'GBotes',
        'Copyright': u'',
        'Description': u'Created from command history with SaveHistoryToQuickScript',
        'Host': u'PaintShop Pro'
        }

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

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

    # Select Color Range
    App.Do( Environment, 'SelectColorRange', {
            'Action': App.Constants.ColorRangeAction.Subtract, 
            'ReferenceColor': (255,255,220), 
            'Softness': 20, 
            'Tolerance': 3, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match
                }
            })

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

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

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

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

    # Fill
    App.Do( Environment, 'Fill', {
            'BlendMode': App.Constants.BlendMode.Normal, 
            'MatchMode': App.Constants.MatchMode.RGBValue, 
            'Material': {
                'Color': (189,255,184), 
                'Pattern': None, 
                'Gradient': None, 
                'Texture': None, 
                'Art': None
                }, 
            'UseForeground': True, 
            'Opacity': 100, 
            'Point': (742.5,257.5), 
            'SampleMerged': True, 
            'Tolerance': 200, 
            '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
                }
            })

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

    # Select Color Range
    App.Do( Environment, 'SelectColorRange', {
            'Action': App.Constants.ColorRangeAction.Subtract, 
            'ReferenceColor': (189,255,184), 
            'Softness': 20, 
            'Tolerance': 3, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match
                }
            })

    # Select Selection Borders
    App.Do( Environment, 'SelectSelectionBorders', {
            'Antialias': True, 
            'BordersType': App.Constants.BordersType.Outside, 
            'BorderWidth': 2, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match
                }
            })

    # Fill
    App.Do( Environment, 'Fill', {
            'BlendMode': App.Constants.BlendMode.Normal, 
            'MatchMode': App.Constants.MatchMode.RGBValue, 
            'Material': {
                'Color': (0,0,0), 
                'Pattern': None, 
                'Gradient': None, 
                'Texture': None, 
                'Art': None
                }, 
            'UseForeground': True, 
            'Opacity': 100, 
            'Point': (592.7,177.9), 
            'SampleMerged': True, 
            'Tolerance': 200, 
            '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
                }
            })

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: Cannot get this working

Post by LeviFiction »

Terrypin, pep8 is a syntax best practices standard. It has nothing to do with whether or not the code will work. It deals with things like "there should be two spaces between imports and the start of your code. Or all lines should be indented 4 spaces instead of 2. That sort of thing. It's all for readability purposes.

None of it deals with Python syntax requirements such as "you indented line 1 with a tab, but line 2 was indented with 2 spaces. Indentation does not match, Python doesn't know where it is or where it is supposed to go, error."

So you can ignore those problems it recorded.

Now, the error "IncorrectParameter" that I got running this script comes from the MagicWand. Again, as I said in the previous thread, you have to be able to guarantee that the location where you click for the magic wand, will always be green in every subsequent image. If you can't do this, you can't use the magic wand tool. In this case if I run the command on the second graph you posted in the original thread the magic wand tool attempts to click at position (831,479) but the second graph is much shorter than the first and so the position 479 is out of bounds.

So if I change the magic wand parameter to be inside the green area, your script runs just fine for me. No errors.

Here are my new recommended steps for the script

1) Select All
2) Selections -> Modify -> Color Range Subtract the green color
3) Selections -> Modify -> Remove Specks and Holes - the default sizes will work just fine.
4) Selection -> Modify -> Contract
4) Fill, match mode none, click anywhere inside the titlebar of the image, since all of your images include this we can reasonably assume it's a good place to click. Just make sure to click as far to the top left as you can without clicking on point 0,0. I did it on point 1,1 for simplicity
5) Selections -> Select None
6) Color Replace All Gray (128,128,12) with Green(189,255,184)

This is more steps. And the end result is almost identical but we don't have to worry about clicking directly inside the green area of the graph to get the selection to work.

You can download my attempt from here - https://goo.gl/Caudxh

It would also be possible to replace the "Fill" command with just a regular "ClearSelection" option. But for that to work we have to set the background color to (235,255,235) before calling the clear selection. It's easy enough, but it has to be done manually. So for the purposes of just doing a straight recorded script Fill will work just fine here.
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: Cannot get this working

Post by terrypin »

Many thanks, grateful for your patience. I've not yet studied your analysis, just impatiently ran it. Finished with green selected and following error:

Executing RunScript
Executing ColorReplacer
Executing UndoLastCmd
Executing ColorReplacerAll
Executing RunScript
Executing SelectAll
Executing Select Color Range
Executing Remove Specks and Holes
Executing Contract Selection
Traceback (most recent call last):
File "C:\Docs\My PSP8 Files\Scripts-Trusted\Elevation Edit.PspScript", line 54, in Do
App.Do( Environment, 'Fill', {
NameError: global name 'False' is not defined

Will now step through it more carefully before I call it a day. Will report back tomorrow.
Thursday 19 November 2015, 2135 UK time


@gbotes,

I'd assembled the two separate scripts you asked for just before seeing LeviFiction's work, but I'll hold off now and focus on LeviFiction's detailes reply. However I may come back to this as I'm still curious to know how to combine them. As I said both were working individually (including the second one with the magic wand), although I haven't tried them on a range of images. But the combined script failed when applied to the same image on which the individual scripts work.

--
Terry, East Grinstead, UK
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
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: Cannot get this working

Post by LeviFiction »

Sorry about that, Terry.

PSP8 uses an older version of Python that doesn't include the default "True" or "False" variables. So the error you're seeing is that Python doesn't recognize what I mean by False.

If you open the script in a Text editor, and find all instances of the word "False" then replace them with a 0 (zero) it should work for you then. I forgot to fix that before posting.
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: Cannot get this working

Post by terrypin »

Bingos! After changing False and True to 0 and 1 respectively it worked a treat.

I'll test it more rigorously tomorrow. And maybe tinker with the colours. Or do that with a subsequent script, to get something like this:

https://dl.dropboxusercontent.com/u/4019461/Day02-4.jpg

Thanks so much for your help.

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