This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > PainShop Pro Scripting > February 2007 > PING Suz: Question re a new script





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 PING Suz: Question re a new script
JoeB

2007-02-03, 6:19 pm

I have a repetitive task where I load a selection from disk onto an
image and then copy and paste as new image, then go back and load a
different selection onto the same image and again copy and paste as new
image, etc. When I'm through with that image I'll repeat the same
process using the same selections on a series of images.

When I start such a project it's simple enough to create and save the
necessary selections then record a script on one image which I can then
run on all of the other images.

However, sometimes I have to go back to some of the images and just
load one particular selection and then copy and paste as new image. My
problem here is that I don't know how to open the Load Selection from
Disk dialogue in a script and then have it wait while I find the
selection I want. You can't record just Load Selection from Disc, you
have to actually load one to have the script record anything. What is
the code needed to just load the dialogue?

That said, I'm sure there are other such dialogues that work the same
way. Is there a specific string I would use to also call those
dialogues and have them wait for user input before continuing with the
script? I can always add Gary's Pause script if necessary to continue
with the subsequent actions like copy, paste, etc., but have to be able
to get the initial dialogue open first.

Thanks for any input!

Regards,

JoeB

Willy

2007-02-03, 6:19 pm


"JoeB" <mymail@myserver.com> wrote in message
news:Xns98CC825AF51DJoeB@216.191.232.194...
>I have a repetitive task where I load a selection from disk onto an
> image and then copy and paste as new image, then go back and load a
> different selection onto the same image and again copy and paste as new
> image, etc. When I'm through with that image I'll repeat the same
> process using the same selections on a series of images.
>
> When I start such a project it's simple enough to create and save the
> necessary selections then record a script on one image which I can then
> run on all of the other images.
>
> However, sometimes I have to go back to some of the images and just
> load one particular selection and then copy and paste as new image. My
> problem here is that I don't know how to open the Load Selection from
> Disk dialogue in a script and then have it wait while I find the
> selection I want. You can't record just Load Selection from Disc, you
> have to actually load one to have the script record anything. What is
> the code needed to just load the dialogue?
>
> That said, I'm sure there are other such dialogues that work the same
> way. Is there a specific string I would use to also call those
> dialogues and have them wait for user input before continuing with the
> script? I can always add Gary's Pause script if necessary to continue
> with the subsequent actions like copy, paste, etc., but have to be able
> to get the initial dialogue open first.
>
> Thanks for any input!
>
> Regards,
>
> JoeB
>


JoeB, I would think making the execution Interactive will do it.
'ExecutionMode': App.Constants.ExecutionMode.Interactive,

Hope I understood correctly.
W

SuzShook

2007-02-03, 6:19 pm



Willy wrote:
> "JoeB" <mymail@myserver.com> wrote in message
> news:Xns98CC825AF51DJoeB@216.191.232.194...
>
> JoeB, I would think making the execution Interactive will do it.
> 'ExecutionMode':
> App.Constants.ExecutionMode.Interactive,
> Hope I understood correctly.
> W


That is correct, Willy. Another thing you might want to do with your
recorded script, Joe, is comment out the FileName line. If you leave it in
there, and the selection you name is not found, it will default to the first
selection in the list of selections. In PSP X, that list is done
alphabetically from the total of all selection folders - I can't remember if
that changed in PSP X or PSP 9. If you comment out that line, it will
default to the last selection you used. So it's 6 of one and half a dozen
of the other, I guess. Suz


JoeB

2007-02-03, 6:19 pm

"Willy" <me@hotmail.com> wrote in news:45c4f027$1_2@cnews:

>
> "JoeB" <mymail@myserver.com> wrote in message
> news:Xns98CC825AF51DJoeB@216.191.232.194...
a[color=darkred]
as new[color=darkred]
the[color=darkred]
then[color=darkred]
just[color=darkred]
image. My[color=darkred]
from[color=darkred]
you[color=darkred]
What is[color=darkred]
same[color=darkred]
the[color=darkred]
continue[color=darkred]
able[color=darkred]
>
> JoeB, I would think making the execution Interactive will do it.
> 'ExecutionMode':

App.Constants.ExecutionMode.Interactive,
>
> Hope I understood correctly.
> W
>


That did the trick, Willy. I just never thought about what would
happen after choosing the selection and then saving the script after
that, but interactive just affects what the default selection is in
the dialogue, and as this little effort is for the purpose of
choosing whatever selection I may want at the time that's not an
issue. Thanks.

Regards,

JoeB
JoeB

2007-02-03, 6:19 pm

"SuzShook" <suzshook@adelphia.net> wrote in news:45c4fd33$1_2@cnews:

>
>
> Willy wrote:
an[color=darkred]
a[color=darkred]
as[color=darkred]
I[color=darkred]
just[color=darkred]
image.[color=darkred]
Selection[color=darkred]
those[color=darkred]
with[color=darkred]
>
> That is correct, Willy. Another thing you might want to do with

your
> recorded script, Joe, is comment out the FileName line. If you

leave
> it in there, and the selection you name is not found, it will

default
> to the first selection in the list of selections. In PSP X, that

list
> is done alphabetically from the total of all selection folders - I
> can't remember if that changed in PSP X or PSP 9. If you comment

out
> that line, it will default to the last selection you used. So it's

6
> of one and half a dozen of the other, I guess. Suz
>


Thanks Suz. I imagine I'll be better off defaulting to the last
selection I used. In PSP9 if that selection isn't there it defaults
to the first selection in the list of the category that is written in
the FileCategory line of the script.

Thanks - I'll remember to use the Interactive thing with other
dialogues I have a similar problem with and see how that works also.

Regards,

JoeB
SuzShook

2007-02-03, 10:17 pm



JoeB wrote:
> "SuzShook" <suzshook@adelphia.net> wrote in news:45c4fd33$1_2@cnews:
>
>
> Thanks Suz. I imagine I'll be better off defaulting to the last
> selection I used. In PSP9 if that selection isn't there it defaults
> to the first selection in the list of the category that is written in
> the FileCategory line of the script.
>
> Thanks - I'll remember to use the Interactive thing with other
> dialogues I have a similar problem with and see how that works also.
>
> Regards,
>
> JoeB


Comment both of them out, Joe, and it will default to the last selection you
used. Suz


JoeB

2007-02-04, 6:19 pm

"SuzShook" <suzshook@adelphia.net> wrote in news:45c51c78$1_3@cnews:

>
>
> JoeB wrote:
@cnews:[color=darkred]
onto[color=darkred]
and[color=darkred]
of[color=darkred]
save[color=darkred]
which I[color=darkred]
new[color=darkred]
Load[color=darkred]
the[color=darkred]
the[color=darkred]
script[color=darkred]
open[color=darkred]
you[color=darkred]
will[color=darkred]
X,[color=darkred]
you[color=darkred]
Suz[color=darkred]
defaults[color=darkred]
in[color=darkred]
also.[color=darkred]
>
> Comment both of them out, Joe, and it will default to the last
> selection you used. Suz
>


Thanks. I'll get the hang of some of this stuff yet!

Regards,

JoeB
Willy

2007-02-04, 6:19 pm

Your script could be as simple as this:

# SelectLoadDisk
App.Do( Environment, 'SelectLoadDisk', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Interactive,
}
})

or if you want to do the last selection you used:

# SelectLoadDisk
App.Do( Environment, 'SelectLoadDisk')

W

"JoeB" <mymail@myserver.com> wrote in message
news:Xns98CC9F2643DA7JoeB@216.191.232.194...
> "Willy" <me@hotmail.com> wrote in news:45c4f027$1_2@cnews:
>
> a
> as new
> the
> then
> just
> image. My
> from
> you
> What is
> same
> the
> continue
> able
> App.Constants.ExecutionMode.Interactive,
>
> That did the trick, Willy. I just never thought about what would
> happen after choosing the selection and then saving the script after
> that, but interactive just affects what the default selection is in
> the dialogue, and as this little effort is for the purpose of
> choosing whatever selection I may want at the time that's not an
> issue. Thanks.
>
> Regards,
>
> JoeB



JoeB

2007-02-04, 10:16 pm

"Willy" <willy@hotmail.com> wrote in news:45c6334b$1_1@cnews:

> Your script could be as simple as this:
>
> # SelectLoadDisk
> App.Do( Environment, 'SelectLoadDisk', {
> 'GeneralSettings': {
> 'ExecutionMode':

App.Constants.ExecutionMode.Interactive,
> }
> })
>
> or if you want to do the last selection you used:
>
> # SelectLoadDisk
> App.Do( Environment, 'SelectLoadDisk')
>
> W
>


Thanks. That works and is simple :-)

You may have read that I deleted the stuff from Suz' script that
brought up her message box 'cause I didn't need the message for my
work. However, it turns out that I could have used that to paste
into scripts I might record when I do want a message box, but now
don't have the code required for that. Any possibility you have a
code snippet that will bring up a message box that just gives a
simple instruction to someone about what settings they should be
entering in the dialogue the script is going to open?

Obviously, what I really need is a reference work where I can find
these types of snippets to add to recorded scripts :-)

Regards,

JoeB
SuzShook

2007-02-04, 10:16 pm

JoeB wrote:
> "Willy" <willy@hotmail.com> wrote in news:45c6334b$1_1@cnews:
>
> App.Constants.ExecutionMode.Interactive,
>
> Thanks. That works and is simple :-)
>
> You may have read that I deleted the stuff from Suz' script that
> brought up her message box 'cause I didn't need the message for my
> work. However, it turns out that I could have used that to paste
> into scripts I might record when I do want a message box, but now
> don't have the code required for that. Any possibility you have a
> code snippet that will bring up a message box that just gives a
> simple instruction to someone about what settings they should be
> entering in the dialogue the script is going to open?
>
> Obviously, what I really need is a reference work where I can find
> these types of snippets to add to recorded scripts :-)
>
> Regards,
>
> JoeB


I think the MsgBox command is explained in the Scripting for Script Authors
manual, isn't it? Yes, it is, and there's a sample script as well. Do you
have that, Joe? Suz


JoeB

2007-02-04, 10:16 pm

"SuzShook" <suzshook@adelphia.net> wrote in news:45c67682$1_3@cnews:

> JoeB wrote:
>
> I think the MsgBox command is explained in the Scripting for Script
> Authors manual, isn't it? Yes, it is, and there's a sample script

as
> well. Do you have that, Joe? Suz
>


Yes, I downloaded it this afternoon and copied the sample script. It
worked fine within the script I've been experimenting with when I
finally deleted the def Do (Environment): line after trying to figure
out what might be causing it to make my script ignore the previous
command.

However, it only shows one line of text, and I recall that there is
special code to make the script start a new line (kind of like the
<br> code in html, as well as code for putting bullets in front of a
line, which I think was in the message box in your script.

I'm just experimenting right now, but my script first duplicates a
vector layer. Then it opens the object layer of the duplicate and
then the Layer Properties dialogue for that object so that people can
change the stroke and fill properties to specific ones that are
necessary. As I don't know enough to write a script that will return
specific stoke/fill propreties different from the existing ones of
the duplicated layer, I thought the message box would be the best way
to tell people how to do the settings.

Also, I presently place the msg box script just before the command
that open the Layer Properties, so the message was to tell the user
which settings to put in for stroke and fill. And because the Layer
Properties box hasn't opened yet it tells them that, once they click
OK, they will see the Layer Properties box. I I tried putting the
message box after the commands that open the Layers Properties
dialogue hoping it would open while the Layer Properties dialogue was
open, but of course that doesn't work and it only opens after you
close the Layers Properties box.

So that's the overview. I can place a message box, but now don't
know how to break the lines, etc. For the few times I need to script
specific stuff like this I really can't justify the time to read and
learn the whole scripting thing in the PDF, and the API stuff I
looked at is completley Greek to me at this stage, I'm afraid.

Regards,

JoeB
Willy

2007-02-05, 3:17 am

\n will cause a line feed.
W

"JoeB" <mymail@myserver.com> wrote in message
news:Xns98CDB9CDBD28CJoeB@216.191.232.194...
> "SuzShook" <suzshook@adelphia.net> wrote in news:45c67682$1_3@cnews:
>
> as
>
> Yes, I downloaded it this afternoon and copied the sample script. It
> worked fine within the script I've been experimenting with when I
> finally deleted the def Do (Environment): line after trying to figure
> out what might be causing it to make my script ignore the previous
> command.
>
> However, it only shows one line of text, and I recall that there is
> special code to make the script start a new line (kind of like the
> <br> code in html, as well as code for putting bullets in front of a
> line, which I think was in the message box in your script.
>
> I'm just experimenting right now, but my script first duplicates a
> vector layer. Then it opens the object layer of the duplicate and
> then the Layer Properties dialogue for that object so that people can
> change the stroke and fill properties to specific ones that are
> necessary. As I don't know enough to write a script that will return
> specific stoke/fill propreties different from the existing ones of
> the duplicated layer, I thought the message box would be the best way
> to tell people how to do the settings.
>
> Also, I presently place the msg box script just before the command
> that open the Layer Properties, so the message was to tell the user
> which settings to put in for stroke and fill. And because the Layer
> Properties box hasn't opened yet it tells them that, once they click
> OK, they will see the Layer Properties box. I I tried putting the
> message box after the commands that open the Layers Properties
> dialogue hoping it would open while the Layer Properties dialogue was
> open, but of course that doesn't work and it only opens after you
> close the Layers Properties box.
>
> So that's the overview. I can place a message box, but now don't
> know how to break the lines, etc. For the few times I need to script
> specific stuff like this I really can't justify the time to read and
> learn the whole scripting thing in the PDF, and the API stuff I
> looked at is completley Greek to me at this stage, I'm afraid.
>
> Regards,
>
> JoeB



Willy

2007-02-05, 3:17 am

Some times I use a print statement to print the settings in the script
output window. That way they are visible and don't go away when you exit the
msg box.. It is nice if you provide instructions to watch the script output
for directions just in case they don't realize the info will be there or
don't have it displayed.

W
"JoeB" <mymail@myserver.com> wrote in message
news:Xns98CDB9CDBD28CJoeB@216.191.232.194...
> "SuzShook" <suzshook@adelphia.net> wrote in news:45c67682$1_3@cnews:
>
> as
>
> Yes, I downloaded it this afternoon and copied the sample script. It
> worked fine within the script I've been experimenting with when I
> finally deleted the def Do (Environment): line after trying to figure
> out what might be causing it to make my script ignore the previous
> command.
>
> However, it only shows one line of text, and I recall that there is
> special code to make the script start a new line (kind of like the
> <br> code in html, as well as code for putting bullets in front of a
> line, which I think was in the message box in your script.
>
> I'm just experimenting right now, but my script first duplicates a
> vector layer. Then it opens the object layer of the duplicate and
> then the Layer Properties dialogue for that object so that people can
> change the stroke and fill properties to specific ones that are
> necessary. As I don't know enough to write a script that will return
> specific stoke/fill propreties different from the existing ones of
> the duplicated layer, I thought the message box would be the best way
> to tell people how to do the settings.
>
> Also, I presently place the msg box script just before the command
> that open the Layer Properties, so the message was to tell the user
> which settings to put in for stroke and fill. And because the Layer
> Properties box hasn't opened yet it tells them that, once they click
> OK, they will see the Layer Properties box. I I tried putting the
> message box after the commands that open the Layers Properties
> dialogue hoping it would open while the Layer Properties dialogue was
> open, but of course that doesn't work and it only opens after you
> close the Layers Properties box.
>
> So that's the overview. I can place a message box, but now don't
> know how to break the lines, etc. For the few times I need to script
> specific stuff like this I really can't justify the time to read and
> learn the whole scripting thing in the PDF, and the API stuff I
> looked at is completley Greek to me at this stage, I'm afraid.
>
> Regards,
>
> JoeB



JoeB

2007-02-05, 3:17 am

"Willy" <willy_id@coldmail.com> wrote in news:45c6a201$1_3@cnews:

> \n will cause a line feed.
> W
>


Thanks Willy. That's the one I was missing!

Regards,

JoeB
JoeB

2007-02-05, 3:17 am

"Willy" <willy_id@coldmail.com> wrote in news:45c6a8b6$1_1@cnews:

> Some times I use a print statement to print the settings in the

script
> output window. That way they are visible and don't go away when you
> exit the msg box.. It is nice if you provide instructions to watch

the
> script output for directions just in case they don't realize the info
> will be there or don't have it displayed.
>
> W



Thanks again. Having the sample script from Scripting for Authors I
can produce the print statement, but your mentioning that I should put
this information in the message dialogue is really good info and I'll
make sure to do it, now that you've also given me the line feed code
snippet needed to keep the message box to a reasonable width.

Regards,

JoeB
SuzShook

2007-02-05, 6:18 pm

JoeB wrote:
> "Willy" <willy_id@coldmail.com> wrote in news:45c6a8b6$1_1@cnews:
>
>
>
> Thanks again. Having the sample script from Scripting for Authors I
> can produce the print statement, but your mentioning that I should put
> this information in the message dialogue is really good info and I'll
> make sure to do it, now that you've also given me the line feed code
> snippet needed to keep the message box to a reasonable width.
>
> Regards,
>
> JoeB


What's good about repeating the info in the Script Output palette, Joe, is
that once that message box goes away, most people will forget what it told
them to do! Therefore, if the message is echoed in the Script Output
palette, they have someplace to go to read the instructions, which can be
very helpful. Of course, if the Script Output palette does not scroll
properly, which I believe is the case with PSP 9, your users will not be
able to read the instructions written there, but there are ways to force
scrolling as well. Let me know if you need this. Suz


JoeB

2007-02-05, 6:18 pm

"SuzShook" <suzshook@adelphia.net> wrote in news:45c7322b$1_3@cnews:

> JoeB wrote:
instructions[color=darkred]
I[color=darkred]
and[color=darkred]
feed[color=darkred]
>
> What's good about repeating the info in the Script Output palette,
> Joe, is that once that message box goes away, most people will

forget
> what it told them to do! Therefore, if the message is echoed in

the
> Script Output palette, they have someplace to go to read the
> instructions, which can be very helpful. Of course, if the Script
> Output palette does not scroll properly, which I believe is the

case
> with PSP 9, your users will not be able to read the instructions
> written there, but there are ways to force scrolling as well. Let

me
> know if you need this. Suz
>


My PSP9.01 script output palette seems to scroll OK. That is, if I
run a script with lots of commands I can see it scroll through the
commands to the end (the scrollbar at right stays at the botton). Is
this the way it's supposed to act?

Regards,

JoeB
JoeB

2007-02-05, 6:18 pm

JoeB <mymail@myserver.com> wrote in news:Xns98CE5953B2C5EJoeB@
216.191.232.194:

> "SuzShook" <suzshook@adelphia.net> wrote in news:45c7322b$1_3

@cnews:
>
> forget
> the
> case
> me
>
> My PSP9.01 script output palette seems to scroll OK. That is, if I
> run a script with lots of commands I can see it scroll through the
> commands to the end (the scrollbar at right stays at the botton).

Is
> this the way it's supposed to act?
>
> Regards,
>
> JoeB
>


Oooops, spoke too soon. The SOP seems to scroll properly when
showing the commands being executed. However, if it reports a script
error then it doesn't quite scroll properly, and you have to manually
scroll it to read the whole thing. I don't have time at the moment
to see if the same thing happens when it prints instructions but I'll
check it out later.

Regards,

JoeB
SuzShook

2007-02-05, 6:18 pm

JoeB wrote:
> JoeB <mymail@myserver.com> wrote in news:Xns98CE5953B2C5EJoeB@
> 216.191.232.194:
>
>
> Oooops, spoke too soon. The SOP seems to scroll properly when
> showing the commands being executed. However, if it reports a script
> error then it doesn't quite scroll properly, and you have to manually
> scroll it to read the whole thing. I don't have time at the moment
> to see if the same thing happens when it prints instructions but I'll
> check it out later.
>
> Regards,
>
> JoeB


Printing instructions is where the problem may be, Joe. Let me know. The
SOP should scroll completely all the time, but it didn't in PSP 9. I think
that was fixed with one of the patches in PSP X. It can be "forced" to
scroll in PSP 9, after instructions are printed - which is necessary in
order to read those instructions if the following dialog requires that you
know what was written.... Anyway, give it a try, and if you find the SOP
does not scroll properly when you write instructions, let me know and I'll
show you how to fix it - it's really simple - you just need to add another
command and it scrolls. I usually just add the GetVersionInfo command - a
one-liner. Suz


JoeB

2007-02-05, 10:17 pm

"SuzShook" <suzshook@adelphia.net> wrote in news:45c7b90b$1_1@cnews:

> JoeB wrote:
palette,[color=darkred]
to[color=darkred]
the[color=darkred]
is[color=darkred]
scrolling[color=darkred]
I[color=darkred]
the[color=darkred]
Is[color=darkred]
script[color=darkred]
manually[color=darkred]
moment[color=darkred]
I'll[color=darkred]
>
> Printing instructions is where the problem may be, Joe. Let me

know.
> The SOP should scroll completely all the time, but it didn't in PSP

9.
> I think that was fixed with one of the patches in PSP X. It can

be
> "forced" to scroll in PSP 9, after instructions are printed - which

is
> necessary in order to read those instructions if the following

dialog
> requires that you know what was written.... Anyway, give it a try,
> and if you find the SOP does not scroll properly when you write
> instructions, let me know and I'll show you how to fix it - it's
> really simple - you just need to add another command and it

scrolls.
> I usually just add the GetVersionInfo command - a one-liner. Suz
>


OK, I've done some testing in v.9.01 with the script I was recording.
Remember, after the message box comes up it opens the Properties
dialogue of a duplicated vector layer. With a long print message
(longer than the SOP has vertical room for) the scroll bar freezes at
the top, so the whole message doesn't display. You can't scroll it
because the Layer Properties dialogue seems to have priority. Once a
user has done their thing with the vector layer properties dialogue
and clicks OK, the script runs to the end and the scroll bar on the
SOP goes to the bottom and you can scroll up and read everything.

Your own 4x6Crop-mod8 script runs with the messages in the SOP
completing and the scrollbar scrolling to the bottom, so that if the
vertical size of the SOP is not sufficient to contain all the info in
your message I have to scroll back up to get to the beginning of your
message to read through the whole thing. But that could be the
result of one of two things, or a combination thereof:

1) You have a GetVersionInfo line in your script so as to tell
it to select either the deform or the pick tool, and

2) Your script doesn't cause another PSP dialogue to open
while mine causes the Vector Layer Properties dialogue to open which
might be what causes the freeze in the SOP.

That's my info to date. Any insight about it?

Regards,

JoeB
SuzShook

2007-02-06, 6:22 pm

JoeB wrote:
> "SuzShook" <suzshook@adelphia.net> wrote in news:45c7b90b$1_1@cnews:
>
>
> OK, I've done some testing in v.9.01 with the script I was recording.
> Remember, after the message box comes up it opens the Properties
> dialogue of a duplicated vector layer. With a long print message
> (longer than the SOP has vertical room for) the scroll bar freezes at
> the top, so the whole message doesn't display. You can't scroll it
> because the Layer Properties dialogue seems to have priority. Once a
> user has done their thing with the vector layer properties dialogue
> and clicks OK, the script runs to the end and the scroll bar on the
> SOP goes to the bottom and you can scroll up and read everything.
>
> Your own 4x6Crop-mod8 script runs with the messages in the SOP
> completing and the scrollbar scrolling to the bottom, so that if the
> vertical size of the SOP is not sufficient to contain all the info in
> your message I have to scroll back up to get to the beginning of your
> message to read through the whole thing. But that could be the
> result of one of two things, or a combination thereof:
>
> 1) You have a GetVersionInfo line in your script so as to tell
> it to select either the deform or the pick tool, and
>
> 2) Your script doesn't cause another PSP dialogue to open
> while mine causes the Vector Layer Properties dialogue to open which
> might be what causes the freeze in the SOP.
>
> That's my info to date. Any insight about it?
>
> Regards,
>
> JoeB


The reason my script scrolls to the bottom is because it's a Pause script,
which is actually more than one script "tied together" - it scrolls to the
bottom because the first script completes. However, if you include print
statements in a script (in PSP 9) that are not followed by an App.Do step of
some kind, you might not see them in the SOP. Therefore, I usually just add
a single command right after the print statements that does cause a line to
be written to the SOP - this forces the print lines to show. I use the
GetVersion command, as it's harmless:
# GetVersionInfo
App.Do(Environment, 'GetVersionInfo', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Silent,
'AutoActionMode': App.Constants.AutoActionMode.Match
}
})
You need to have this command run in silent mode in order to force a line to
be written to the SOP. If your script is running in interactive mode, step
termination messages don't get written to the SOP, so you need to code for
that possibility.

Of course, if your printed message is very long, it won't all show unless
the SOP is very large, so if you're writing a script to share with others,
you need to take this into consideration.

Hope this helps, Joe. Suz


JoeB

2007-02-06, 6:22 pm

"SuzShook" <suzshook@adelphia.net> wrote in news:45c8747b$1_1@cnews:

> JoeB wrote:
@cnews:[color=darkred]
scroll[color=darkred]
will[color=darkred]
are[color=darkred]
this.[color=darkred]
if[color=darkred]
through[color=darkred]
to[color=darkred]
at[color=darkred]
didn't[color=darkred]
can[color=darkred]
you[color=darkred]
recording.[color=darkred]
at[color=darkred]
it[color=darkred]
Once a[color=darkred]
dialogue[color=darkred]
the[color=darkred]
the[color=darkred]
in[color=darkred]
your[color=darkred]
which[color=darkred]
>
> The reason my script scrolls to the bottom is because it's a Pause
> script, which is actually more than one script "tied together" - it
> scrolls to the bottom because the first script completes. However,

if
> you include print statements in a script (in PSP 9) that are not
> followed by an App.Do step of some kind, you might not see them in

the
> SOP. Therefore, I usually just add a single command right after

the
> print statements that does cause a line to be written to the SOP -
> this forces the print lines to show. I use the GetVersion command,

as
> it's harmless:
> # GetVersionInfo
> App.Do(Environment, 'GetVersionInfo', {
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Silent,
> 'AutoActionMode': App.Constants.AutoActionMode.Match
> }
> })
> You need to have this command run in silent mode in order to force

a
> line to be written to the SOP. If your script is running in
> interactive mode, step termination messages don't get written to

the
> SOP, so you need to code for that possibility.
>
> Of course, if your printed message is very long, it won't all show
> unless the SOP is very large, so if you're writing a script to

share
> with others, you need to take this into consideration.
>
> Hope this helps, Joe. Suz
>


That does the trick nicely, Suz, and your explanation of why it works
is very useful also. Thank!

Regards,

JoeB
SuzShook

2007-02-06, 6:22 pm



JoeB wrote:
> "SuzShook" <suzshook@adelphia.net> wrote in news:45c8747b$1_1@cnews:
>
> Once a
>
> That does the trick nicely, Suz, and your explanation of why it works
> is very useful also. Thank!
>
> Regards,
>
> JoeB


Glad to help, Joe. Will make a full-fledged scripter out of you yet! Suz


Willy

2007-02-06, 6:22 pm

Another way I have used to keep the SOP uncluttered is to put a
App.Do( Environment, 'ScriptWndClear' )
before the next print output of settings I want used.
W

"JoeB" <mymail@myserver.com> wrote in message
news:Xns98CF65329BEJoeB@216.191.232.194...
> "SuzShook" <suzshook@adelphia.net> wrote in news:45c8747b$1_1@cnews:
>
> @cnews:
> scroll
> will
> are
> this.
> if
> through
> to
> at
> didn't
> can
> you
> recording.
> at
> it
> Once a
> dialogue
> the
> the
> in
> your
> which
> if
> the
> the
> as
> a
> the
> share
>
> That does the trick nicely, Suz, and your explanation of why it works
> is very useful also. Thank!
>
> Regards,
>
> JoeB



JoeB

2007-02-07, 6:25 pm

"Willy" <willy@hotmail.com> wrote in news:45c8bab7$1_1@cnews:

> Another way I have used to keep the SOP uncluttered is to put a
> App.Do( Environment, 'ScriptWndClear' )
> before the next print output of settings I want used.
> W
>


That's a thought also. Thanks for the snippet.

Regards,

JoeB
SuzShook

2007-02-07, 6:25 pm

This option (using the ScriptWndClear command) shows text written to the SOP
differently depending on whether you are running the script interactively,
or silently. In interactive mode, the text is shown from the top; in silent
mode, the SOP is scrolled to the bottom, so the bottom of the text shows.
Of course, if you don't write much text to the SOP, this is probably a moot
point. But I think it's important to note the differences. And it appears
to work the same way in PSP 9 and PSP X. However, that might depend on what
follows the print commands - I just tested with a MsgBox command following
the print lines. Interesting.... Suz

JoeB wrote:
> "Willy" <willy@hotmail.com> wrote in news:45c8bab7$1_1@cnews:
>
>
> That's a thought also. Thanks for the snippet.
>
> Regards,
>
> JoeB



JoeB

2007-02-07, 10:16 pm

"SuzShook" <suzshook@adelphia.net> wrote in news:45ca27ec_2@cnews:

> This option (using the ScriptWndClear command) shows text written

to
> the SOP differently depending on whether you are running the script
> interactively, or silently. In interactive mode, the text is shown
> from the top; in silent mode, the SOP is scrolled to the bottom, so
> the bottom of the text shows. Of course, if you don't write much

text
> to the SOP, this is probably a moot point. But I think it's

important
> to note the differences. And it appears to work the same way in

PSP 9
> and PSP X. However, that might depend on what follows the print
> commands - I just tested with a MsgBox command following the print
> lines. Interesting.... Suz
>


More good info I'm filing away for future use (given I don't do this
stuff all that often :-)

Out of curiosity, what was the "interesting" result of following the
print statement with a MsgBox command? I'm not sure where one would
actually use that in a script because I don't even usually record
scripts that need message output to the SOP or a message box so can't
envision (off the top of my head) a situation where that might be
required.

Regards,

JoeB


> JoeB wrote:
>
>
>


Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews