Text variables

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
zopita
Newbie
Posts: 19
Joined: Wed Feb 18, 2009 5:45 pm
Location: Spain

Text variables

Post by zopita » Wed Feb 18, 2009 6:10 pm

Hi!

I have some text variables: variable1, variable2, variable3, etc.
For each one I must make some tasks in Word (search and replace). I maked the script for this tasks, but I need:

execute some times the script for variable 1
then
execute some times for variable2
then
execute some times for variable3
etc.

How can I make it?

Thanks!

zopita - Spain

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Feb 18, 2009 6:27 pm

Not sure what you are doing, but maybe this will help.

Code: Select all

Let>Variable1=abc
Let>Variable2=def
Let>Variable3=ghi
Let>Count=0

Label>SomeProcess
Let>Count=Count+1
Let>SearchValue=Variable%Count%
MessageModal>Search value is %SearchValue%
// Copy Variable into clipboard and paste into Search field in Word
PutClipBoard>%SearchValue%
// Move to Search field and past from clipboard
Press>CTRL
Send>v
Release>CTRL
Wait>10
If>%Count%=3,End,SomeProcess

Label>End
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Re: Text variables

Post by jpuziano » Wed Feb 18, 2009 6:33 pm

Hi zopita,
zopita wrote:execute some times the script for variable 1
then
execute some times for variable2
then
execute some times for variable3
etc.

How can I make it?
The simple way would be to make three separate scripts and assign each one a separate Hot Key, lets call them Hot Keys 1, 2 and 3.

Use would then be as follows:

1) hit Hot Key 1 to execute for variable 1
2) hit Hot Key 2 to execute for variable 2
3) hit Hot Key 3 to execute for variable 3
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Feb 18, 2009 6:49 pm

Rereading your request, I wonder if this is what you meant?

You have a script that performs a task using a text value that could change, that is the variable you mean.... Then define the variable in the script and pass the value to the variable on your command line to run the script

Sample Script,MyTest.scp:

Code: Select all

MessageModal>Seach value is %SearchValue%
Start the macro, these three lines will give you three different results:
MacroScheduler.exe /MyTest.scp /SearchValue=abc
MacroScheduler.exe /MyTest.scp /SearchValue=def
MacroScheduler.exe /MyTest.scp /SearchValue=ghi

(Oops, did not see reply from jpuziano that suggested three different scripts. This solution only requires one script, but must be started from different command lines or icons).
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

zopita
Newbie
Posts: 19
Joined: Wed Feb 18, 2009 5:45 pm
Location: Spain

Thanks

Post by zopita » Thu Mar 05, 2009 11:32 am

jpuziano, Bob, thanks your very very much :D

Best regards. zopita

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts