This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > PainShop Pro Scripting > January 2007 > Beginner tutorial on using (my) scripts
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Beginner tutorial on using (my) scripts
|
|
|
|
http://members.home.nl/j.backer/usi...ng-scripts.html
Every once in a while there will be someone using PSP who is still
wary of using scripts. On my site I host a fairly large number of
(free and paid) scripts that produce attractive outcomes and that
are fun for the user to experiment with. I thought it would be a
shame for those wary of scripts not to try out scripts that can be
useful or entertaining for them - so I wrote this tutorial for
absolute script beginners.
Joske
http://members.home.nl/j.a.c.backer/gif-index.html
| |
| HISsparrow 2006-12-06, 8:09 pm |
|
Great instructions. Easy to understand. Thanks Joske.
God bless,
Carla
"Joske" <j.backer@home.nl> wrote in message news:45736d00_3@cnews...
>
> http://members.home.nl/j.backer/usi...ng-scripts.html
>
> Every once in a while there will be someone using PSP who is still
> wary of using scripts. On my site I host a fairly large number of
> (free and paid) scripts that produce attractive outcomes and that
> are fun for the user to experiment with. I thought it would be a
> shame for those wary of scripts not to try out scripts that can be
> useful or entertaining for them - so I wrote this tutorial for
> absolute script beginners.
>
> Joske
> http://members.home.nl/j.a.c.backer/gif-index.html
>
>
>
>
>
| |
| Patricia 2006-12-06, 8:09 pm |
|
"Joske" <j.backer@home.nl> wrote in message news:45736d00_3@cnews...
>
> http://members.home.nl/j.backer/usi...ng-scripts.html
>
> Every once in a while there will be someone using PSP who is still
> wary of using scripts. On my site I host a fairly large number of
> (free and paid) scripts that produce attractive outcomes and that
> are fun for the user to experiment with. I thought it would be a
> shame for those wary of scripts not to try out scripts that can be
> useful or entertaining for them - so I wrote this tutorial for
> absolute script beginners.
>
> Joske
> http://members.home.nl/j.a.c.backer/gif-index.html
>
>
>
>
This was a good idea Joske. I hear so many say they have no idea how to use
scripts. Next time I will refer them to your site. It's a well thought out
tut....Pat
| |
|
|
Very good, this will help a lot of people new to scripts. I have most of
your scripts they are really cool
Susi
"Joske" <j.backer@home.nl> wrote in message news:45736d00_3@cnews...
>
> http://members.home.nl/j.backer/usi...ng-scripts.html
>
> Every once in a while there will be someone using PSP who is still
> wary of using scripts. On my site I host a fairly large number of
> (free and paid) scripts that produce attractive outcomes and that
> are fun for the user to experiment with. I thought it would be a
> shame for those wary of scripts not to try out scripts that can be
> useful or entertaining for them - so I wrote this tutorial for
> absolute script beginners.
>
> Joske
> http://members.home.nl/j.a.c.backer/gif-index.html
>
>
>
>
>
| |
|
|
Patricia wrote:
> "Joske" wrote
[color=darkred]
[color=darkred]
> This was a good idea Joske. I hear so many say they have no idea
> how to use scripts. Next time I will refer them to your site.
> It's a well thought out tut....
Thanks Pat. I've been thinking what would be the easiest script to
give running them a first try. I think it might be the Gingham From
Color
http://members.home.nl/j.backer/gingham/gingham.html
because it works with a few simple selections and fills, there's
nothing else to distract the user.
Joske
| |
|
|
HISsparrow wrote:
> Great instructions. Easy to understand. Thanks Joske.
Thank you too Carla of the pretty Xmas kit. It was the best I could
do, so I hope you're right.
Joske
| |
|
|
nospamfrozentush@XXXXXXXXXX wrote:
> Very good, this will help a lot of people new to scripts. I have
> most of your scripts they are really cool
That's always nice to hear. Right now I'm looking at the piles of
old or unfinished scripts to see what on earth I have been up to and
whether they would be nice for others :-)
It's a pity some are still so much in awe of running scripts. Once
they got used to that, they might even record one themselves.
Joske
| |
| Patricia 2006-12-06, 8:09 pm |
|
"Joske" <j.backer@home.nl> wrote in message news:45743e87_1@cnews...
>
> Patricia wrote:
>
>
>
>
> Thanks Pat. I've been thinking what would be the easiest script to
> give running them a first try. I think it might be the Gingham From
> Color
>
> http://members.home.nl/j.backer/gingham/gingham.html
>
> because it works with a few simple selections and fills, there's
> nothing else to distract the user.
>
> Joske
I think the gingham would be a good example Joske as nothing to distract
them and they should be able to get an idea of what is happening. I just
jumped in the deep end with scripts and figured out how to record etc but
would really love to get the time to do it properly. Many of my recorded
scripts don't work the way I want them to later on as I haven't been able
to figure out the way to change the settings for the materials palette etc.
Hence when I run some of the scripts the sample is built from the original
colour and patterns I had selected. Might add this to my list for next year
and do a course or something.
Well done on this initiative and I hope it gets the more timid in giving it
a go...Pat
| |
|
|
Patricia wrote:
> "Joske" wrote
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
> I think the gingham would be a good example Joske as nothing to
> distract them and they should be able to get an idea of what is
> happening. I just jumped in the deep end with scripts and figured
> out how to record etc but would really love to get the time to do
> it properly. Many of my recorded scripts don't work the way I
> want them to later on as I haven't been able to figure out the
> way to change the settings for the materials palette etc. Hence
> when I run some of the scripts the sample is built from the
> original colour and patterns I had selected. Might add this to my
> list for next year and do a course or something.
> Well done on this initiative and I hope it gets the more timid in
> giving it a go...Pat
Recording doesn't always produce a useful script, it's true. It's
fine for batch processing or recording a filter setting, but with
all else, often the script will have to be edited.
For instance, if you fill with a color, recording will just catch
whether it's a foreground or a background color. And when saving
from the history, you won't catch things like creating a new file.
But the history will remember the exact fill color. This is why I
use both, recording and saving from History.
Joske
| |
|
|
"Joske" <j.backer@home.nl> wrote in news:45755f46$1_2@cnews:
>
> Patricia wrote:
>
scripts.html[color=darkred]
>
idea[color=darkred]
site.[color=darkred]
>
script[color=darkred]
there's[color=darkred]
>
to[color=darkred]
is[color=darkred]
figured[color=darkred]
do[color=darkred]
Hence[color=darkred]
my[color=darkred]
in[color=darkred]
>
> Recording doesn't always produce a useful script, it's true.
It's
> fine for batch processing or recording a filter setting, but
with
> all else, often the script will have to be edited.
>
> For instance, if you fill with a color, recording will just
catch
> whether it's a foreground or a background color. And when
saving
> from the history, you won't catch things like creating a new
file.
> But the history will remember the exact fill color. This is why
I
> use both, recording and saving from History.
>
> Joske
>
Perhaps I am misunderstanding you, Joske, but it sounds as if
you're saying that recording a script will only remember whether
you use the background or foreground swatch but will not remember
a specific color for the swatch while recording from the history
will remember the color. My experience with PSP9 is that if you
record a script and, while recording, select specific colors for
the swatches and fill, then when you run the script it does
remember the colors you chose, regardless of what colors are in
the materials palette swatches at the time you run it.
Regards,
JoeB
| |
|
|
JoeB wrote:
> "Joske" wrote
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
> Perhaps I am misunderstanding you, Joske, but it sounds as if
> you're saying that recording a script will only remember whether
> you use the background or foreground swatch but will not remember
> a specific color for the swatch while recording from the history
> will remember the color. My experience with PSP9 is that if you
> record a script and, while recording, select specific colors for
> the swatches and fill, then when you run the script it does
> remember the colors you chose, regardless of what colors are in
> the materials palette swatches at the time you run it.
In PSP X, which I'm using, only the last used foreground and
background material are recorded in the script, and whether they are
a foreground or background material (true/false):
# Fill
App.Do( Environment, 'Fill', {
'BlendMode': App.Constants.BlendMode.Normal,
'MatchMode': App.Constants.MatchMode.None,
'Material': None,
'UseForeground': True,
'Opacity': 100,
'Point': (10,10),
'SampleMerged': False,
'Tolerance': 20,
'GeneralSettings': {
'ExecutionMode':
App.Constants.ExecutionMode.Default,
'AutoActionMode':
App.Constants.AutoActionMode.Match,
'Version': ((10,0,3),1)
}
})
It's no different when, while recording, you make that extra
material choice. It made me grumble, until I got the knack of having
several scripts open in ConTEXT (the editor I use for scripting)
among which the quickscript.
Patricia, whom I replied to, mentions the same problem.
Joske
| |
|
|
"Joske" <j.backer@home.nl> wrote in news:4575d70a_2@cnews:
>
> JoeB wrote:
>
It's[color=darkred]
with[color=darkred]
>
catch[color=darkred]
saving[color=darkred]
This[color=darkred]
>
whether[color=darkred]
remember[color=darkred]
history[color=darkred]
you[color=darkred]
for[color=darkred]
in[color=darkred]
>
>
> In PSP X, which I'm using, only the last used foreground and
> background material are recorded in the script, and whether
they are
> a foreground or background material (true/false):
>
> # Fill
> App.Do( Environment, 'Fill', {
> 'BlendMode': App.Constants.BlendMode.Normal,
> 'MatchMode': App.Constants.MatchMode.None,
> 'Material': None,
> 'UseForeground': True,
> 'Opacity': 100,
> 'Point': (10,10),
> 'SampleMerged': False,
> 'Tolerance': 20,
> 'GeneralSettings': {
> 'ExecutionMode':
> App.Constants.ExecutionMode.Default,
> 'AutoActionMode':
> App.Constants.AutoActionMode.Match,
> 'Version': ((10,0,3),1)
> }
> })
>
> It's no different when, while recording, you make that extra
> material choice. It made me grumble, until I got the knack of
having
> several scripts open in ConTEXT (the editor I use for
scripting)
> among which the quickscript.
>
> Patricia, whom I replied to, mentions the same problem.
>
> Joske
>
Below is the test script I made. I started recording, selected
the fill tool, set a foreground color, then set a background
color, and filled an image first with the foreground color then
with the background color, then saved the script. Now I can
change the foreground and background colors in the materials
palette, open an image, run the script, and if fills with the
colors I recorded, not those in the materials palette. Is that
what you are trying to achieve?
# Fill
App.Do( Environment, 'Fill', {
'BlendMode': App.Constants.BlendMode.Normal,
'MatchMode': App.Constants.MatchMode.RGBValue,
'Material': {
'Color': (255,255,64),
'Pattern': None,
'Gradient': None,
'Texture': None,
'Art': None
},
'UseForeground': True,
'Opacity': 100,
'Point': (164.5,146.5),
'SampleMerged': False,
'Tolerance': 20,
'GeneralSettings': {
'ExecutionMode':
App.Constants.ExecutionMode.Default,
'AutoActionMode':
App.Constants.AutoActionMode.Match,
'Version': ((9,0,0),1)
}
})
# Fill
App.Do( Environment, 'Fill', {
'BlendMode': App.Constants.BlendMode.Normal,
'MatchMode': App.Constants.MatchMode.RGBValue,
'Material': {
'Color': (255,255,64),
'Pattern': None,
'Gradient': None,
'Texture': None,
'Art': None
},
'UseForeground': True,
'Opacity': 100,
'Point': (56.5,62.5),
'SampleMerged': False,
'Tolerance': 20,
'GeneralSettings': {
'ExecutionMode':
App.Constants.ExecutionMode.Default,
'AutoActionMode':
App.Constants.AutoActionMode.Match,
'Version': ((9,0,0),1)
}
})
# Fill
App.Do( Environment, 'Fill', {
'BlendMode': App.Constants.BlendMode.Normal,
'MatchMode': App.Constants.MatchMode.RGBValue,
'Material': {
'Color': (64,255,64),
'Pattern': None,
'Gradient': None,
'Texture': None,
'Art': None
},
'UseForeground': False,
'Opacity': 100,
'Point': (58.5,99.5),
'SampleMerged': False,
'Tolerance': 20,
'GeneralSettings': {
'ExecutionMode':
App.Constants.ExecutionMode.Default,
'AutoActionMode':
App.Constants.AutoActionMode.Match,
'Version': ((9,0,0),1)
}
})
Regards,
JoeB
| |
|
|
JoeB wrote:
> "Joske" wrote
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
> Below is the test script I made.
> [ ]
> Is that what you are trying to achieve?
> [snip PSP 9 recorded script]
I'm not trying to achieve anything, Joe. Does it appear so from this
conversation? Then somewhere along the line someone must have read
or worded things badly :-)
By the way, I just finished another script.
You can find all my scripts here:
http://members.home.nl/j.a.c.backer/gif-index.html
Joske
| |
| Patricia 2006-12-06, 8:09 pm |
|
"Joske" <j.backer@home.nl> wrote in message news:45755f46$1_2@cnews...
>
> Patricia wrote:
>
>
>
> Recording doesn't always produce a useful script, it's true. It's
> fine for batch processing or recording a filter setting, but with
> all else, often the script will have to be edited.
>
> For instance, if you fill with a color, recording will just catch
> whether it's a foreground or a background color. And when saving
> from the history, you won't catch things like creating a new file.
> But the history will remember the exact fill color. This is why I
> use both, recording and saving from History.
>
> Joske
>
I also save from history into scripts at times Joske but never thought that
the process would be any different to the normal recording of scripts so
when I get time will look at the two different methods ...Pat
| |
|
|
"Joske" <j.backer@home.nl> wrote in news:4575e63b$1_1@cnews:
>
> JoeB wrote:
>
>
>
>
> I'm not trying to achieve anything, Joe. Does it appear so from
this
> conversation? Then somewhere along the line someone must have
read
> or worded things badly :-)
>
> By the way, I just finished another script.
> You can find all my scripts here:
> http://members.home.nl/j.a.c.backer/gif-index.html
>
> Joske
>
I think you took my use of the word "achieve" too literally, and
I think I also find I had misunderstood what you were saying. :-)
I had thought you were saying that PSPX recorded scripts would
only use the colors present in the materials palette when the
script was run and would not remember the colors selected when
the script was recorded, but that a script saved from the history
palette would do so. Re-reading your stuff makes me realize I
had not read carefully enough so had the wrong idea.
That said, I went to your site and wasn't sure which was the new
script you were referring to. Are the ones with the flashing
little squares the new ones, because I see several flashing
squares?
Regards,
JoeB
| |
|
|
Patricia wrote:
> I also save from history into scripts at times Joske but never
> thought that the process would be any different to the normal
> recording of scripts so when I get time will look at the two
> different methods ...Pat
Recording is needed when you want the script to create a new image
or when for instance you duplicate or close it. The history doesn't
include those steps.
If you don't do those things and, let's say, you want to use a
foreground and a background material, you can record with Save
Materials unchecked. Then before you run the script, you simply set
the foreground and background material, which the script will use. A
few of my scripts work this way, but right now I can't remember
which so I'd have to look :-)
Joske
| |
|
|
JoeB wrote:
> "Joske" wrote
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
> I think you took my use of the word "achieve" too literally, and
> I think I also find I had misunderstood what you were saying. :-)
That's probably me. I do a lot intuitively or automatic and can find
it hard to put into words, especially in English.
> I had thought you were saying that PSPX recorded scripts would
> only use the colors present in the materials palette when the
> script was run and would not remember the colors selected when
> the script was recorded, but that a script saved from the history
> palette would do so. Re-reading your stuff makes me realize I
> had not read carefully enough so had the wrong idea.
The materials will only be taken along when Save Materials is
checked. But to me, when you create scripts for others to use,
that's a hassle: I want to take along Colors at most, and usually
only so that the user can keep or change them. The hassle is in
editing out anything the user may not have on their own system (a
particular gradient, pattern) and bringing things down to Material:
'name given by me'. So I use a cross between recording and saving
from quickscript in case I do need a specific color, and I don't
have the Save Materials checked.
Something else about recording is that it tends to get 'unstable'
when you've been recording and running for a longer while. Sometimes
whole materials get included in the code when Save Materials is
checked, and it will forget that Remove Undone Commands is checked.
That latter can be a real hassle because you'll have to wade through
the code meticulously deleting one or more actions before undo
instructions. This is another reason I usually just record my first
(new image) and major (duplicate image) steps and then continue to
add from the history.
> That said, I went to your site and wasn't sure which was the new
> script you were referring to. Are the ones with the flashing
> little squares the new ones, because I see several flashing
> squares?
Yes, those are new :-)
Joske
| |
| Patricia 2007-01-10, 8:50 pm |
|
"Joske" <j.backer@home.nl> wrote in message news:4576d447_1@cnews...
>
> Patricia wrote:
>
>
> Recording is needed when you want the script to create a new image
> or when for instance you duplicate or close it. The history doesn't
> include those steps.
>
> If you don't do those things and, let's say, you want to use a
> foreground and a background material, you can record with Save
> Materials unchecked. Then before you run the script, you simply set
> the foreground and background material, which the script will use. A
> few of my scripts work this way, but right now I can't remember
> which so I'd have to look :-)
>
> Joske
>
Thanks for that info Joske. One particular script I saved was using some
filters to make a nice background effect I liked. But each time I wanted to
use it later I found it would only use my original pattern input. I realise
on reading your email I probably had save materials checked. For some reason
I think I thought that included the settings in the filters but now realise
that it probably means the material boxes. Will give that script another go
and remove the material palette setting and see how I go...Pat
| |
|
|
Patricia wrote:
> "Joske" wrote
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
> Thanks for that info Joske. One particular script I saved was
> using some filters to make a nice background effect I liked. But
> each time I wanted to use it later I found it would only use my
> original pattern input. I realise on reading your email I
> probably had save materials checked. For some reason I think I
> thought that included the settings in the filters but now realise
> that it probably means the material boxes. Will give that script
> another go and remove the material palette setting and see how I
> go...Pat
The easiest way to have control over the material used in the filter
is to set that part of the code to interactive. Then while the
script runs, it will show the effect dialog so that you can change
the settings. When you then click OK in the dialog, the script
continues using the settings the user put in the effect.
Here's an example. Can you see the word Interactive? I manually
typed that in where before it said Default. You can also see that
initially the filter came up using the settings the script recorder
had put in. This is handy, because this means the user can also
choose those by clicking OK instead of altering them.
# Halftone
App.Do( Environment, 'Halftone', {
'BackgroundColor': (120,10,70),
'ColorScheme': App.Constants.ColorScheme.Greyscale,
'HalftonePattern': App.Constants.HalftonePattern.Line,
'Overlay': True,
'OverlayBlendMode': App.Constants.BlendMode.Normal,
'OverlayOpacity': 84,
'PatternColor': (32,32,32),
'ScreenAngles': (45,45,45),
'Size': 2,
'TransparentBackground': True,
'GeneralSettings': {
'ExecutionMode':
App.Constants.ExecutionMode.Interactive,
'AutoActionMode':
App.Constants.AutoActionMode.Match,
'Version': ((10,0,3),1)
}
})
Joske
--
http://members.home.nl/j.a.c.backer/
| |
| Patricia 2007-01-10, 8:50 pm |
|
"Joske" <j.backer@home.nl> wrote in message news:45781dbd$1_1@cnews...
>
> Patricia wrote:
>
>
> The easiest way to have control over the material used in the filter
> is to set that part of the code to interactive. Then while the
> script runs, it will show the effect dialog so that you can change
> the settings. When you then click OK in the dialog, the script
> continues using the settings the user put in the effect.
>
> Here's an example. Can you see the word Interactive? I manually
> typed that in where before it said Default. You can also see that
> initially the filter came up using the settings the script recorder
> had put in. This is handy, because this means the user can also
> choose those by clicking OK instead of altering them.
>
>
> # Halftone
> App.Do( Environment, 'Halftone', {
> 'BackgroundColor': (120,10,70),
> 'ColorScheme': App.Constants.ColorScheme.Greyscale,
> 'HalftonePattern': App.Constants.HalftonePattern.Line,
> 'Overlay': True,
> 'OverlayBlendMode': App.Constants.BlendMode.Normal,
> 'OverlayOpacity': 84,
> 'PatternColor': (32,32,32),
> 'ScreenAngles': (45,45,45),
> 'Size': 2,
> 'TransparentBackground': True,
> 'GeneralSettings': {
> 'ExecutionMode':
> App.Constants.ExecutionMode.Interactive,
> 'AutoActionMode':
> App.Constants.AutoActionMode.Match,
> 'Version': ((10,0,3),1)
> }
> })
>
> Joske
> --
> http://members.home.nl/j.a.c.backer/
>
Thanks for these tips Joske. I opened up the script and changed the first
two defaults to interactive as you mentioned and renamed the script. On
running it still fills with my original pattern 'Ice 1' choice though. This
is what I'm trying to overcome. I wanted to apply my filter steps to any
pattern of my choice. The only way I knew how was to make another script
starting from after the pattern fill hence I do that manually and then run
the script.
The first part of the altered script up to the fill being applied and
getting ready for noise tool is below.
from JascApp import *
def ScriptProperties():
return {
'Author': u'Pat Watts',
'Copyright': u'',
'Description': u'',
'Host': u'Paint Shop Pro 9',
'Host Version': u'9.01'
}
def Do(Environment):
# EnableOptimizedScriptUndo
App.Do( Environment, 'EnableOptimizedScriptUndo', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Interactive,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((9,0,1),1)
}
})
# Fill
App.Do( Environment, 'Fill', {
'BlendMode': App.Constants.BlendMode.Normal,
'MatchMode': App.Constants.MatchMode.None,
'Material': {
'Color': None,
'Pattern': {
'Name': u'Ice1',
'Image': None,
'Angle': 78.8371,
'Scale': 100
},
'Gradient': None,
'Texture': None,
'Art': None
},
'UseForeground': False,
'Opacity': 100,
'Point': (295.5,144.5),
'SampleMerged': False,
'Tolerance': 20,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Interactive,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((9,0,1),1)
}
})
| |
|
|
Patricia wrote:
[snips for brevity]
> Thanks for these tips Joske. I opened up the script and changed
> the first two defaults to interactive as you mentioned and
> renamed the script. On running it still fills with my original
> pattern 'Ice 1' choice though. This is what I'm trying to
> overcome. I wanted to apply my filter steps to any pattern of my
> choice. The only way I knew how was to make another script
> starting from after the pattern fill hence I do that manually and
> then run the script.
> The first part of the altered script up to the fill being applied
> and getting ready for noise tool is below.
Okay, the way you wrote it I gathered that you wanted to be able to
have control over a filter. This one's easy: the quickest way to
pick a fill is to set it beforehand. Let the script use a Foreground
or a Background fill instead of a fixed material. We'll take the
Background fill because your code already says that UseForeground is
False:
# Fill
App.Do( Environment, 'Fill', {
'BlendMode': App.Constants.BlendMode.Normal,
'MatchMode': App.Constants.MatchMode.None,
'Material': None,
'UseForeground': False,
'Opacity': 100,
'Point': (295.5,144.5),
'SampleMerged': False,
'Tolerance': 20,
'GeneralSettings': {
'ExecutionMode':
App.Constants.ExecutionMode.Default,
'AutoActionMode':
App.Constants.AutoActionMode.Match,
'Version': ((10,0,3),1)
}
})
Can you tell which parts of your code have disappeared, and what
Material now says? I deleted all the details for Material and made
it None instead.
What you can do now is set a background material in the Materials
Palette before you run the script.
Joske
--
http://members.home.nl/j.a.c.backer/
| |
| Spandex Rutabaga 2007-01-10, 8:50 pm |
|
Patricia wrote:
> Thanks for these tips Joske. I opened up the script and changed the first
> two defaults to interactive as you mentioned and renamed the script. On
> running it still fills with my original pattern 'Ice 1' choice though.
Look at your script. You have set Color to None. You have set
Gradient to None. What have you set Pattern to? It's picking
what you chose. Make it None as well. Then if you set
UseForeground to True the script should use whatever is set
as the foreground swatch at the time it runs. (At least that's
my understanding.) You probably want to fix the pattern Angle
at zero as well. Also beware of the click point for the Fill
tool. If the pixel coordinate (295.5, 144.5) lies outside your
image because the image is small you won't get any fill. Using
(0.0, 0.0) for the coordinate instead will guarantee that the
pixel exists in any size of image.
> This
> is what I'm trying to overcome. I wanted to apply my filter steps to any
> pattern of my choice. The only way I knew how was to make another script
> starting from after the pattern fill hence I do that manually and then run
> the script.
>
> The first part of the altered script up to the fill being applied and
> getting ready for noise tool is below.
>
> from JascApp import *
>
> def ScriptProperties():
> return {
> 'Author': u'Pat Watts',
> 'Copyright': u'',
> 'Description': u'',
> 'Host': u'Paint Shop Pro 9',
> 'Host Version': u'9.01'
> }
>
> def Do(Environment):
> # EnableOptimizedScriptUndo
> App.Do( Environment, 'EnableOptimizedScriptUndo', {
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Interactive,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
> # Fill
> App.Do( Environment, 'Fill', {
> 'BlendMode': App.Constants.BlendMode.Normal,
> 'MatchMode': App.Constants.MatchMode.None,
> 'Material': {
> 'Color': None,
> 'Pattern': {
> 'Name': u'Ice1',
> 'Image': None,
> 'Angle': 78.8371,
> 'Scale': 100
> },
> 'Gradient': None,
> 'Texture': None,
> 'Art': None
> },
> 'UseForeground': False,
> 'Opacity': 100,
> 'Point': (295.5,144.5),
> 'SampleMerged': False,
> 'Tolerance': 20,
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Interactive,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
| |
|
|
Spandex Rutabaga <SpRu@agabatur.xednaps> wrote in
news:45798706.DECCE202@agabatur.xednaps:
[snipped]
> Also beware of the click point for the Fill
> tool. If the pixel coordinate (295.5, 144.5) lies outside your
> image because the image is small you won't get any fill. Using
> (0.0, 0.0) for the coordinate instead will guarantee that the
> pixel exists in any size of image.
>
That raises a question. Joske's script makes 4 separate 100 pixel
square selections within a 200 pixel image. Does the pixel
coordinate setting always apply to the image as a whole, or if a
selection is active will it be constrained to the selection? I
suspect the former.
Regards,
JoeB
| |
|
|
JoeB wrote:
> Spandex Rutabaga wrote
>
> [snipped]
[color=darkred]
> That raises a question. Joske's script makes 4 separate 100 pixel
> square selections within a 200 pixel image. Does the pixel
> coordinate setting always apply to the image as a whole, or if a
> selection is active will it be constrained to the selection? I
> suspect the former.
The point itself does not recognize or respect the selection
boundaries, but the fill does. The point is for the whole of the
canvas, counting from 0 horizontal and 0 vertical for the whole
image.
Joske
| |
|
|
"Joske" <j.backer@home.nl> wrote in news:4579a4d1_2@cnews:
>
> JoeB wrote:
>
your[color=darkred]
Using[color=darkred]
>
pixel[color=darkred]
a[color=darkred]
I[color=darkred]
>
> The point itself does not recognize or respect the selection
> boundaries, but the fill does. The point is for the whole of
the
> canvas, counting from 0 horizontal and 0 vertical for the whole
> image.
>
> Joske
>
Thanks. I assume that means that you can always use the zero
coordinates as long as you have a selection because the fill
itself will be constrained to the selection. That would be good
because otherwise it might be difficult to fill an irregular
selection.
Regards,
JoeB
| |
|
|
JoeB wrote:
> "Joske" wrote
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
> Thanks. I assume that means that you can always use the zero
> coordinates as long as you have a selection because the fill
> itself will be constrained to the selection. That would be good
> because otherwise it might be difficult to fill an irregular
> selection.
Why can it be so hard to explain what I know and what I know I mean?
:-) No, you cannot use the zero coordinates for a selection. If you
want to do something with a selection, you will have to click within
the selection to get a point. But the point is counted from the
boundaries of the canvas, not of the selection.
Joske
| |
| Spandex Rutabaga 2007-01-10, 8:50 pm |
|
JoeB wrote:
> That raises a question. Joske's script makes 4 separate 100 pixel
> square selections within a 200 pixel image. Does the pixel
> coordinate setting always apply to the image as a whole,
Yes.
> or if a
> selection is active will it be constrained to the selection?
No.
> I suspect the former.
You are right to be suspicious.
> Regards,
>
> JoeB
| |
| Spandex Rutabaga 2007-01-10, 8:50 pm |
|
JoeB wrote:
> Thanks. I assume that means that you can always use the zero
> coordinates as long as you have a selection because the fill
> itself will be constrained to the selection.
It is wrong to assume :) You need to the fill point to be inside
the selection.
> That would be good
> because otherwise it might be difficult to fill an irregular
> selection.
With the resources provided by Corel it would be. However, there
is a solution provided by Gary Barton to fill an arbitrary
selection. Locate the FindSelectionPoint script at this link
http://pixelnook.home.comcast.net/TheLab.html
> Regards,
>
> JoeB
| |
| Nicole 2007-01-10, 8:50 pm |
|
Thank you very much to share your work, this will help me to understand more
the scripting method.
Nicole
"Joske" <j.backer@home.nl> a écrit dans le message de news:
45736d00_3@cnews...
>
> http://members.home.nl/j.backer/usi...ng-scripts.html
>
> Every once in a while there will be someone using PSP who is still
> wary of using scripts. On my site I host a fairly large number of
> (free and paid) scripts that produce attractive outcomes and that
> are fun for the user to experiment with. I thought it would be a
> shame for those wary of scripts not to try out scripts that can be
> useful or entertaining for them - so I wrote this tutorial for
> absolute script beginners.
>
> Joske
> http://members.home.nl/j.a.c.backer/gif-index.html
>
>
>
>
>
| |
| Patricia 2007-01-10, 8:50 pm |
|
"Joske" <j.backer@home.nl> wrote in message news:45797ee8_1@cnews...
>
> Patricia wrote:
> [snips for brevity]
>
>
>
> Okay, the way you wrote it I gathered that you wanted to be able to
> have control over a filter. This one's easy: the quickest way to
> pick a fill is to set it beforehand. Let the script use a Foreground
> or a Background fill instead of a fixed material. We'll take the
> Background fill because your code already says that UseForeground is
> False:
>
> # Fill
> App.Do( Environment, 'Fill', {
> 'BlendMode': App.Constants.BlendMode.Normal,
> 'MatchMode': App.Constants.MatchMode.None,
> 'Material': None,
> 'UseForeground': False,
> 'Opacity': 100,
> 'Point': (295.5,144.5),
> 'SampleMerged': False,
> 'Tolerance': 20,
> 'GeneralSettings': {
> 'ExecutionMode':
> App.Constants.ExecutionMode.Default,
> 'AutoActionMode':
> App.Constants.AutoActionMode.Match,
> 'Version': ((10,0,3),1)
> }
> })
>
> Can you tell which parts of your code have disappeared, and what
> Material now says? I deleted all the details for Material and made
> it None instead.
>
> What you can do now is set a background material in the Materials
> Palette before you run the script.
>
> Joske
> --
> http://members.home.nl/j.a.c.backer/
>
Thanks so much Joske, understand it better and will try and spend a few
minutes on it today to at least get that first step running. Really
appreciate your help on this and now I might be able to go through some of
my others ones that have the same problem....Pat
| |
| Patricia 2007-01-10, 8:50 pm |
|
"Spandex Rutabaga" <SpRu@agabatur.xednaps> wrote in message
news:45798706.DECCE202@agabatur.xednaps...
>
> Patricia wrote:
>
>
> Look at your script. You have set Color to None. You have set
> Gradient to None. What have you set Pattern to? It's picking
> what you chose. Make it None as well. Then if you set
> UseForeground to True the script should use whatever is set
> as the foreground swatch at the time it runs. (At least that's
> my understanding.) You probably want to fix the pattern Angle
> at zero as well. Also beware of the click point for the Fill
> tool. If the pixel coordinate (295.5, 144.5) lies outside your
> image because the image is small you won't get any fill. Using
> (0.0, 0.0) for the coordinate instead will guarantee that the
> pixel exists in any size of image.
>
Okay Spandex. Thanks very much for taking the time to reply. That is so much
clearer to me now and gives me a basic understanding I can go forward with.
Getting excited that I may actually be able to rectify some of my old
recorded scripts and a challenge for me to learn and understand more of how
these work....Pat
| |
|
|
"Joske" <j.backer@home.nl> wrote in news:4579be2d$1_2@cnews:
>
> JoeB wrote:
>
your[color=darkred]
Using[color=darkred]
the[color=darkred]
>
whole,[color=darkred]
>
the[color=darkred]
whole[color=darkred]
>
good[color=darkred]
>
> Why can it be so hard to explain what I know and what I know I
mean?
>:-) No, you cannot use the zero coordinates for a selection. If
you
> want to do something with a selection, you will have to click
within
> the selection to get a point. But the point is counted from the
> boundaries of the canvas, not of the selection.
>
> Joske
>
Got it now. I was thinking that perhaps if there was a selection
within the script then PSP would honor the selection as a
priority to honoring the point for something like Fill. Wrong
assumption :-)
Regards,
JoeB
| |
|
|
Spandex Rutabaga <SpRu@agabatur.xednaps> wrote in
news:4579C5B5.59800859@agabatur.xednaps:
>
> JoeB wrote:
>
>
> It is wrong to assume :) You need to the fill point to be
inside
> the selection.
>
>
> With the resources provided by Corel it would be. However,
there
> is a solution provided by Gary Barton to fill an arbitrary
> selection. Locate the FindSelectionPoint script at this link
> http://pixelnook.home.comcast.net/TheLab.html
>
Thanks for the link!
Regards,
JoeB
| |
| Vanessa 2007-01-10, 8:50 pm |
|
Butting in here......since I have been directed to this site for help and
advice........*g*......this is my problem at the moment. Sometimes, when I
record a script for myself, I have the option to change the pattern and/or
gradient, and sometimes I don't, which I am finding frustrating. I am able
to change the colours, but not the pattern or gradient........?? Is there
something I should be checking, or unchecking..?
"Patricia" <wattspatara@NOSPAMXXXXXXXXXX> wrote in message
news:4578cf4d_3@cnews...
>
>
> "Joske" <j.backer@home.nl> wrote in message news:45781dbd$1_1@cnews...
> Thanks for these tips Joske. I opened up the script and changed the first
> two defaults to interactive as you mentioned and renamed the script. On
> running it still fills with my original pattern 'Ice 1' choice though.
> This is what I'm trying to overcome. I wanted to apply my filter steps to
> any pattern of my choice. The only way I knew how was to make another
> script starting from after the pattern fill hence I do that manually and
> then run the script.
>
> The first part of the altered script up to the fill being applied and
> getting ready for noise tool is below.
>
>
> from JascApp import *
>
> def ScriptProperties():
> return {
> 'Author': u'Pat Watts',
> 'Copyright': u'',
> 'Description': u'',
> 'Host': u'Paint Shop Pro 9',
> 'Host Version': u'9.01'
> }
>
> def Do(Environment):
> # EnableOptimizedScriptUndo
> App.Do( Environment, 'EnableOptimizedScriptUndo', {
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Interactive,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
> # Fill
> App.Do( Environment, 'Fill', {
> 'BlendMode': App.Constants.BlendMode.Normal,
> 'MatchMode': App.Constants.MatchMode.None,
> 'Material': {
> 'Color': None,
> 'Pattern': {
> 'Name': u'Ice1',
> 'Image': None,
> 'Angle': 78.8371,
> 'Scale': 100
> },
> 'Gradient': None,
> 'Texture': None,
> 'Art': None
> },
> 'UseForeground': False,
> 'Opacity': 100,
> 'Point': (295.5,144.5),
> 'SampleMerged': False,
> 'Tolerance': 20,
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Interactive,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
>
| |
| Vanessa 2007-01-10, 8:50 pm |
|
I should have mentioned that I am using Version 8.10.........;-)
"Vanessa" <hasday@nowherenohow> wrote in message news:459347a7_3@cnews...
>
> Butting in here......since I have been directed to this site for help and
> advice........*g*......this is my problem at the moment. Sometimes, when
> I record a script for myself, I have the option to change the pattern
> and/or gradient, and sometimes I don't, which I am finding frustrating. I
> am able to change the colours, but not the pattern or gradient........??
> Is there something I should be checking, or unchecking..?
>
>
> "Patricia" <wattspatara@NOSPAMXXXXXXXXXX> wrote in message
> news:4578cf4d_3@cnews...
>
>
>
| |
|
|
| Vanessa 2007-01-10, 8:50 pm |
|
Okay, Joske........thank you.............I will try this. The script is one
I recorded when following a tutorial........
"Joske" <j.backer@home.nl> wrote in message news:4593eac1_1@cnews...[color=darkred]
>
> Vanessa wrote:
>
>
> Hi Vanessa.
>
|
|
|
| | Copyright 2003 - 2009 forum4designers.com Software forum Computer Hardware reviews |
|