Automating a task, f.e. in Paint Shop Pro

  • Thread starter Thread starter Screaming Eagles 101
  • Start date Start date
S

Screaming Eagles 101

Hi,

is there any SW or trick that helps to automate a task ?
I have to do the same manipulation (adding a shadow border) to 200 pictures
in Paint Shop Pro.
If something can help, so that I do only have to open and/or save the file,
that would help saving time.

I know it's possible to write a macro in Adobe Photoshop,
but here we have to use PSP, and my guess is you can't write a macro in PSP.

Phil
 
Perhaps you should ask on a PaintShop Pro newsgroup?


--
The people think the Constitution protects their rights;
But government sees it as an obstacle to be overcome.


message | Hi,
|
| is there any SW or trick that helps to automate a task ?
| I have to do the same manipulation (adding a shadow
border) to 200 pictures
| in Paint Shop Pro.
| If something can help, so that I do only have to open
and/or save the file,
| that would help saving time.
|
| I know it's possible to write a macro in Adobe Photoshop,
| but here we have to use PSP, and my guess is you can't
write a macro in PSP.
|
| Phil
|
| --
| http://users.tijd.com/fiwi
|
|
 
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "%{TAB}^c%{TAB}^v"
[above sends Alt + Tab, Ctrl + C, Alt + Tab, then Ctrl + V]

Then set a shortcut to the scripts and set a hotkey for the shortcut (see help)


Windows Script Host

SendKeys Method
See Also
WshShell Object | Run Method

Sends one or more keystrokes to the active window (as if typed on the keyboard).

object.SendKeys(string)
Arguments
object
WshShell object.
string
String value indicating the keystroke(s) you want to send.
Remarks
Use the SendKeys method to send keystrokes to applications that have no automation interface. Most keyboard characters are represented by a single keystroke. Some keyboard characters are made up of combinations of keystrokes (CTRL+SHIFT+HOME, for example). To send a single keyboard character, send the character itself as the string argument. For example, to send the letter x, send the string argument "x".

Note To send a space, send the string " ".
You can use SendKeys to send more than one keystroke at a time. To do this, create a compound string argument that represents a sequence of keystrokes by appending each keystroke in the sequence to the one before it. For example, to send the keystrokes a, b, and c, you would send the string argument "abc". The SendKeys method uses some characters as modifiers of characters (instead of using their face-values). This set of special characters consists of parentheses, brackets, braces, and the:

a.. plus sign "+",
b.. caret "^",
c.. percent sign "%",
d.. and tilde "~"
Send these characters by enclosing them within braces "{}". For example, to send the plus sign, send the string argument "{+}". Brackets "[ ]" have no special meaning when used with SendKeys, but you must enclose them within braces to accommodate applications that do give them a special meaning (for dynamic data exchange (DDE) for example).

a.. To send bracket characters, send the string argument "{[}" for the left bracket and "{]}" for the right one.
b.. To send brace characters, send the string argument "{{}" for the left brace and "{}}" for the right one.
Some keystrokes do not generate characters (such as ENTER and TAB). Some keystrokes represent actions (such as BACKSPACE and BREAK). To send these kinds of keystrokes, send the arguments shown in the following table:

Key Argument
BACKSPACE {BACKSPACE}, {BS}, or {BKSP}
BREAK {BREAK}
CAPS LOCK {CAPSLOCK}
DEL or DELETE {DELETE} or {DEL}
DOWN ARROW {DOWN}
END {END}
ENTER {ENTER} or ~
ESC {ESC}
HELP {HELP}
HOME {HOME}
INS or INSERT {INSERT} or {INS}
LEFT ARROW {LEFT}
NUM LOCK {NUMLOCK}
PAGE DOWN {PGDN}
PAGE UP {PGUP}
PRINT SCREEN {PRTSC}
RIGHT ARROW {RIGHT}
SCROLL LOCK {SCROLLLOCK}
TAB {TAB}
UP ARROW {UP}
F1 {F1}
F2 {F2}
F3 {F3}
F4 {F4}
F5 {F5}
F6 {F6}
F7 {F7}
F8 {F8}
F9 {F9}
F10 {F10}
F11 {F11}
F12 {F12}
F13 {F13}
F14 {F14}
F15 {F15}
F16 {F16}

To send keyboard characters that are comprised of a regular keystroke in combination with a SHIFT, CTRL, or ALT, create a compound string argument that represents the keystroke combination. You do this by preceding the regular keystroke with one or more of the following special characters:

Key Special Character
SHIFT +
CTRL ^
ALT %

Note When used this way, these special characters are not enclosed within a set of braces.
To specify that a combination of SHIFT, CTRL, and ALT should be held down while several other keys are pressed, create a compound string argument with the modified keystrokes enclosed in parentheses. For example, to send the keystroke combination that specifies that the SHIFT key is held down while:

a.. e and c are pressed, send the string argument "+(ec)".
b.. e is pressed, followed by a lone c (with no SHIFT), send the string argument "+ec".
You can use the SendKeys method to send a pattern of keystrokes that consists of a single keystroke pressed several times in a row. To do this, create a compound string argument that specifies the keystroke you want to repeat, followed by the number of times you want it repeated. You do this using a compound string argument of the form {keystroke number}. For example, to send the letter "x" ten times, you would send the string argument "{x 10}". Be sure to include a space between keystroke and number.

Note The only keystroke pattern you can send is the kind that is comprised of a single keystroke pressed several times. For example, you can send "x" ten times, but you cannot do the same for "Ctrl+x".
Note You cannot send the PRINT SCREEN key {PRTSC} to an application.
Example
The following example demonstrates the use of a single .wsf file for two jobs in different script languages (VBScript and JScript). Each job runs the Windows calculator and sends it keystrokes to execute a simple calculation.

<package>
<job id="vbs">
<script language="VBScript">
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "calc"
WScript.Sleep 100
WshShell.AppActivate "Calculator"
WScript.Sleep 100
WshShell.SendKeys "1{+}"
WScript.Sleep 500
WshShell.SendKeys "2"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 500
WshShell.SendKeys "*3"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 2500
</script>
</job>

<job id="js">
<script language="JScript">
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.Run("calc");
WScript.Sleep(100);
WshShell.AppActivate("Calculator");
WScript.Sleep(100);
WshShell.SendKeys ("1{+}");
WScript.Sleep(500);
WshShell.SendKeys("2");
WScript.Sleep(500);
WshShell.SendKeys("~");
WScript.Sleep(500);
WshShell.SendKeys("*3");
WScript.Sleep(500);
WshShell.SendKeys("~");
WScript.Sleep(2500);
</script>
</job>
</package>
See Also
WshShell Object | Run Method
 
Jim Macklin said:
Perhaps you should ask on a PaintShop Pro newsgroup?


You're right if it is a PSP solution, but I don't know any PSP newsgroups
(don't find it in the list).
It could be a Windows solution though...
 
Screaming said:
"Jim Macklin" <p51mustang[threeX12]@xxxhotmail.calm>
schreef in bericht
Perhaps you should ask on a PaintShop Pro newsgroup?


You're right if it is a PSP solution, but I don't know
any PSP newsgroups (don't find it in the list).
It could be a Windows solution though...
================================
FWIW...there are some PSP groups on usenet.

Try the following link:

comp.graphic.apps.paint-shop-pro
http://tinyurl.com/5yfof

--

John Inzer
Picture It! MVP
return e-mail disabled

Picture It! Support Center
http://tinyurl.com/2po2o

Digital Image Support Center
http://tinyurl.com/3xxqg
 
PERFECT !!!
That is really absolutely perfect.
Will save me a LOOOOOT of time !
PHIL
--
http://users.tijd.com/fiwi


"David Candy" <[email protected]> schreef in bericht
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "%{TAB}^c%{TAB}^v"
[above sends Alt + Tab, Ctrl + C, Alt + Tab, then Ctrl + V]

Then set a shortcut to the scripts and set a hotkey for the shortcut (see
help)


Windows Script Host

SendKeys Method
See Also
WshShell Object | Run Method

Sends one or more keystrokes to the active window (as if typed on the
keyboard).

object.SendKeys(string)
Arguments
object
WshShell object.
string
String value indicating the keystroke(s) you want to send.
Remarks
Use the SendKeys method to send keystrokes to applications that have no
automation interface. Most keyboard characters are represented by a single
keystroke. Some keyboard characters are made up of combinations of
keystrokes (CTRL+SHIFT+HOME, for example). To send a single keyboard
character, send the character itself as the string argument. For example, to
send the letter x, send the string argument "x".

Note To send a space, send the string " ".
You can use SendKeys to send more than one keystroke at a time. To do this,
create a compound string argument that represents a sequence of keystrokes
by appending each keystroke in the sequence to the one before it. For
example, to send the keystrokes a, b, and c, you would send the string
argument "abc". The SendKeys method uses some characters as modifiers of
characters (instead of using their face-values). This set of special
characters consists of parentheses, brackets, braces, and the:

a.. plus sign "+",
b.. caret "^",
c.. percent sign "%",
d.. and tilde "~"
Send these characters by enclosing them within braces "{}". For example, to
send the plus sign, send the string argument "{+}". Brackets "[ ]" have no
special meaning when used with SendKeys, but you must enclose them within
braces to accommodate applications that do give them a special meaning (for
dynamic data exchange (DDE) for example).

a.. To send bracket characters, send the string argument "{[}" for the
left bracket and "{]}" for the right one.
b.. To send brace characters, send the string argument "{{}" for the left
brace and "{}}" for the right one.
Some keystrokes do not generate characters (such as ENTER and TAB). Some
keystrokes represent actions (such as BACKSPACE and BREAK). To send these
kinds of keystrokes, send the arguments shown in the following table:

Key Argument
BACKSPACE {BACKSPACE}, {BS}, or {BKSP}
BREAK {BREAK}
CAPS LOCK {CAPSLOCK}
DEL or DELETE {DELETE} or {DEL}
DOWN ARROW {DOWN}
END {END}
ENTER {ENTER} or ~
ESC {ESC}
HELP {HELP}
HOME {HOME}
INS or INSERT {INSERT} or {INS}
LEFT ARROW {LEFT}
NUM LOCK {NUMLOCK}
PAGE DOWN {PGDN}
PAGE UP {PGUP}
PRINT SCREEN {PRTSC}
RIGHT ARROW {RIGHT}
SCROLL LOCK {SCROLLLOCK}
TAB {TAB}
UP ARROW {UP}
F1 {F1}
F2 {F2}
F3 {F3}
F4 {F4}
F5 {F5}
F6 {F6}
F7 {F7}
F8 {F8}
F9 {F9}
F10 {F10}
F11 {F11}
F12 {F12}
F13 {F13}
F14 {F14}
F15 {F15}
F16 {F16}

To send keyboard characters that are comprised of a regular keystroke in
combination with a SHIFT, CTRL, or ALT, create a compound string argument
that represents the keystroke combination. You do this by preceding the
regular keystroke with one or more of the following special characters:

Key Special Character
SHIFT +
CTRL ^
ALT %

Note When used this way, these special characters are not enclosed
within a set of braces.
To specify that a combination of SHIFT, CTRL, and ALT should be held down
while several other keys are pressed, create a compound string argument with
the modified keystrokes enclosed in parentheses. For example, to send the
keystroke combination that specifies that the SHIFT key is held down while:

a.. e and c are pressed, send the string argument "+(ec)".
b.. e is pressed, followed by a lone c (with no SHIFT), send the string
argument "+ec".
You can use the SendKeys method to send a pattern of keystrokes that
consists of a single keystroke pressed several times in a row. To do this,
create a compound string argument that specifies the keystroke you want to
repeat, followed by the number of times you want it repeated. You do this
using a compound string argument of the form {keystroke number}. For
example, to send the letter "x" ten times, you would send the string
argument "{x 10}". Be sure to include a space between keystroke and number.

Note The only keystroke pattern you can send is the kind that is
comprised of a single keystroke pressed several times. For example, you can
send "x" ten times, but you cannot do the same for "Ctrl+x".
Note You cannot send the PRINT SCREEN key {PRTSC} to an application.
Example
The following example demonstrates the use of a single .wsf file for two
jobs in different script languages (VBScript and JScript). Each job runs the
Windows calculator and sends it keystrokes to execute a simple calculation.

<package>
<job id="vbs">
<script language="VBScript">
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "calc"
WScript.Sleep 100
WshShell.AppActivate "Calculator"
WScript.Sleep 100
WshShell.SendKeys "1{+}"
WScript.Sleep 500
WshShell.SendKeys "2"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 500
WshShell.SendKeys "*3"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 2500
</script>
</job>

<job id="js">
<script language="JScript">
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.Run("calc");
WScript.Sleep(100);
WshShell.AppActivate("Calculator");
WScript.Sleep(100);
WshShell.SendKeys ("1{+}");
WScript.Sleep(500);
WshShell.SendKeys("2");
WScript.Sleep(500);
WshShell.SendKeys("~");
WScript.Sleep(500);
WshShell.SendKeys("*3");
WScript.Sleep(500);
WshShell.SendKeys("~");
WScript.Sleep(2500);
</script>
</job>
</package>
See Also
WshShell Object | Run Method
 
"David Candy" <[email protected]> schreef in bericht
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "%{TAB}^c%{TAB}^v"
[above sends Alt + Tab, Ctrl + C, Alt + Tab, then Ctrl + V]

Then set a shortcut to the scripts and set a hotkey for the shortcut (see
help)


Windows Script Host

SendKeys Method
See Also
WshShell Object | Run Method

Sends one or more keystrokes to the active window (as if typed on the
keyboard).

object.SendKeys(string)
Arguments
object
WshShell object.
string
String value indicating the keystroke(s) you want to send.
Remarks
Use the SendKeys method to send keystrokes to applications that have no
automation interface. Most keyboard characters are represented by a single
keystroke. Some keyboard characters are made up of combinations of
keystrokes (CTRL+SHIFT+HOME, for example). To send a single keyboard
character, send the character itself as the string argument. For example, to
send the letter x, send the string argument "x".

Note To send a space, send the string " ".
You can use SendKeys to send more than one keystroke at a time. To do this,
create a compound string argument that represents a sequence of keystrokes
by appending each keystroke in the sequence to the one before it. For
example, to send the keystrokes a, b, and c, you would send the string
argument "abc". The SendKeys method uses some characters as modifiers of
characters (instead of using their face-values). This set of special
characters consists of parentheses, brackets, braces, and the:

a.. plus sign "+",
b.. caret "^",
c.. percent sign "%",
d.. and tilde "~"
Send these characters by enclosing them within braces "{}". For example, to
send the plus sign, send the string argument "{+}". Brackets "[ ]" have no
special meaning when used with SendKeys, but you must enclose them within
braces to accommodate applications that do give them a special meaning (for
dynamic data exchange (DDE) for example).

a.. To send bracket characters, send the string argument "{[}" for the
left bracket and "{]}" for the right one.
b.. To send brace characters, send the string argument "{{}" for the left
brace and "{}}" for the right one.
Some keystrokes do not generate characters (such as ENTER and TAB). Some
keystrokes represent actions (such as BACKSPACE and BREAK). To send these
kinds of keystrokes, send the arguments shown in the following table:

Key Argument
BACKSPACE {BACKSPACE}, {BS}, or {BKSP}
BREAK {BREAK}
CAPS LOCK {CAPSLOCK}
DEL or DELETE {DELETE} or {DEL}
DOWN ARROW {DOWN}
END {END}
ENTER {ENTER} or ~
ESC {ESC}
HELP {HELP}
HOME {HOME}
INS or INSERT {INSERT} or {INS}
LEFT ARROW {LEFT}
NUM LOCK {NUMLOCK}
PAGE DOWN {PGDN}
PAGE UP {PGUP}
PRINT SCREEN {PRTSC}
RIGHT ARROW {RIGHT}
SCROLL LOCK {SCROLLLOCK}
TAB {TAB}
UP ARROW {UP}
F1 {F1}
F2 {F2}
F3 {F3}
F4 {F4}
F5 {F5}
F6 {F6}
F7 {F7}
F8 {F8}
F9 {F9}
F10 {F10}
F11 {F11}
F12 {F12}
F13 {F13}
F14 {F14}
F15 {F15}
F16 {F16}

To send keyboard characters that are comprised of a regular keystroke in
combination with a SHIFT, CTRL, or ALT, create a compound string argument
that represents the keystroke combination. You do this by preceding the
regular keystroke with one or more of the following special characters:

Key Special Character
SHIFT +
CTRL ^
ALT %

Note When used this way, these special characters are not enclosed
within a set of braces.
To specify that a combination of SHIFT, CTRL, and ALT should be held down
while several other keys are pressed, create a compound string argument with
the modified keystrokes enclosed in parentheses. For example, to send the
keystroke combination that specifies that the SHIFT key is held down while:

a.. e and c are pressed, send the string argument "+(ec)".
b.. e is pressed, followed by a lone c (with no SHIFT), send the string
argument "+ec".
You can use the SendKeys method to send a pattern of keystrokes that
consists of a single keystroke pressed several times in a row. To do this,
create a compound string argument that specifies the keystroke you want to
repeat, followed by the number of times you want it repeated. You do this
using a compound string argument of the form {keystroke number}. For
example, to send the letter "x" ten times, you would send the string
argument "{x 10}". Be sure to include a space between keystroke and number.

Note The only keystroke pattern you can send is the kind that is
comprised of a single keystroke pressed several times. For example, you can
send "x" ten times, but you cannot do the same for "Ctrl+x".
Note You cannot send the PRINT SCREEN key {PRTSC} to an application.
Example
The following example demonstrates the use of a single .wsf file for two
jobs in different script languages (VBScript and JScript). Each job runs the
Windows calculator and sends it keystrokes to execute a simple calculation.

<package>
<job id="vbs">
<script language="VBScript">
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "calc"
WScript.Sleep 100
WshShell.AppActivate "Calculator"
WScript.Sleep 100
WshShell.SendKeys "1{+}"
WScript.Sleep 500
WshShell.SendKeys "2"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 500
WshShell.SendKeys "*3"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 2500
</script>
</job>

<job id="js">
<script language="JScript">
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.Run("calc");
WScript.Sleep(100);
WshShell.AppActivate("Calculator");
WScript.Sleep(100);
WshShell.SendKeys ("1{+}");
WScript.Sleep(500);
WshShell.SendKeys("2");
WScript.Sleep(500);
WshShell.SendKeys("~");
WScript.Sleep(500);
WshShell.SendKeys("*3");
WScript.Sleep(500);
WshShell.SendKeys("~");
WScript.Sleep(2500);
</script>
</job>
</package>
See Also
WshShell Object | Run Method

-----------------
I have put the code into a VB6 project and made an executable out of it,
so I could also use the SLEEP method (not possible in a HTML file).

Now I can see clearly what it's doing, and
now I also added some button to do also the Gamma Correction
(with the preferred) gamma value in a textbox.

Saving the new image, I do it with a copy first of its old filename to wich
I add some minor text...
The sky is the limit here....
Even if PSP has scripting funtion as they say, in PSP 8 or 9,
this solution above here is helping me automating everything I want in PSP
7...

I can make a new image out of an older one, add shadow, borders, change the
resolution, and save it with a new name
all in a few seconds... HANDY !

Thanks

PHIL
 
Back
Top