operations on variables

Discuss RoboTask here
tombur
Posts: 24
Joined: Mon Aug 25, 2008 11:59 pm

operations on variables

Post by tombur »

i dont know why  in one application it works from system try without this command "restore robotask" on top of task and in onother application where my task is needed for me it works only with that "restore robotask " command . most important for me is that It works anyway. I wish only one another thing. On first step of task robotask thisplays a question form "how many times repeat this task ?" I am inputing eg. 3 and robotask perform this task three times. Is it possible to do using loops ?
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

operations on variables

Post by Oleg »

Hmm, I don't understand why do you need restore RoboTask? It works fine in minimized mode. Maybe you need to add some pauses after sending keystrokes. You have to give your application some time to respond. I think that 0.1 - 0.2 s is enough.

Also you made a few standard mistakes:
1. Step 6 (Create variable "WAGA1" with value "{ClipBoardContent}")
I think you need to ON the checkbox "Expand variable value" if you want to save the content of clipboard instead of string "{ClipBoardContent}"

2. Step 9-11 (Evaluate)
You have to write variable name only in the field "Assign result to variable", without brackets.
You have to use brackets {} onluy if you want to insert the content of variable into some expression while execution of the task.

See my edition of the task below:

;*****************************
;* RoboTask Task file       
;* Do not edit in text editor!
;*****************************

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|0
CatID=INTEGER|1746330413
ContinueOnError=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task590"
Hide=INTEGER|0
ID=INTEGER|1241965760
Name=STRING|"UPUST 0.5 - sbterm (imported)"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action13=FOLDER
Action14=FOLDER
Action15=FOLDER
Action16=FOLDER
Action17=FOLDER
Action18=FOLDER
Action19=FOLDER
Action2=FOLDER
Action20=FOLDER
Action21=FOLDER
Action22=FOLDER
Action23=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_ROBOTASK_RESTORE"
Enabled=INTEGER|0
Name=STRING|"Restore RoboTask"

[Actions\Action10]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create variable ""UPUST"" with value """""
Params=FOLDER

[Actions\Action10\Params]
expand=STRING|"0"
varname=STRING|"UPUST"

[Actions\Action11]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create variable ""WAGA2"" with value """""
Params=FOLDER

[Actions\Action11\Params]
expand=STRING|"0"
varname=STRING|"WAGA2"

[Actions\Action12]
ActionID=STRING|"BASIC_EVALUATE"
Enabled=INTEGER|-1
Name=STRING|"Evaluate"
Params=FOLDER

[Actions\Action12\Params]
expression=STRING|"replace(""{WAGA1}"","","",""."")"
variable=STRING|"{WAGA1}"

[Actions\Action13]
ActionID=STRING|"BASIC_EVALUATE"
Enabled=INTEGER|-1
Name=STRING|"Evaluate"
Params=FOLDER

[Actions\Action13\Params]
expression=STRING|"{WAGA1}*0.005"
variable=STRING|"{UPUST}"

[Actions\Action14]
ActionID=STRING|"BASIC_EVALUATE"
Enabled=INTEGER|-1
Name=STRING|"Evaluate"
Params=FOLDER

[Actions\Action14\Params]
expression=STRING|"{WAGA1}-{UPUST}"
variable=STRING|"{WAGA2}"

[Actions\Action15]
ActionID=STRING|"A_CLIPBOARD_CLEAR"
Enabled=INTEGER|-1
Name=STRING|"Clear Clipboard"

[Actions\Action16]
ActionID=STRING|"A_CLIPBOARD_PUT"
Enabled=INTEGER|-1
Name=STRING|"Put Text"
Params=FOLDER

[Actions\Action16\Params]
line0=STRING|"{WAGA2}"
linecount=STRING|"1"
sourcetext=STRING|"1"

[Actions\Action17]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""WAGA1"""
Params=FOLDER

[Actions\Action17\Params]
varname=STRING|"WAGA1"

[Actions\Action18]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""WAGA2"""
Params=FOLDER

[Actions\Action18\Params]
varname=STRING|"WAGA2"

[Actions\Action19]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""UPUST"""
Params=FOLDER

[Actions\Action19\Params]
varname=STRING|"UPUST"

[Actions\Action2]
ActionID=STRING|"A_CLIPBOARD_CLEAR"
Enabled=INTEGER|-1
Name=STRING|"Clear Clipboard"

[Actions\Action20]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to ""sbterm"""
Params=FOLDER

[Actions\Action20\Params]
currentwindow=STRING|"0"
fixedwindow=STRING|"0"
keylayout=STRING|"0"
keys=STRING|"{ENTER}"
sendkind=STRING|"0"
wincaption=STRING|"sbterm"

[Actions\Action21]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 200 ms"
Params=FOLDER

[Actions\Action21\Params]
delay=STRING|"2"

[Actions\Action22]
ActionID=STRING|"A_CLIPBOARD_PASTE"
Enabled=INTEGER|-1
Name=STRING|"Paste"
Params=FOLDER

[Actions\Action22\Params]
mode=STRING|"1"

[Actions\Action23]
ActionID=STRING|"A_CLIPBOARD_CLEAR"
Enabled=INTEGER|-1
Name=STRING|"Clear Clipboard"

[Actions\Action3]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to ""sbterm"""
Params=FOLDER

[Actions\Action3\Params]
currentwindow=STRING|"0"
fixedwindow=STRING|"0"
keylayout=STRING|"0"
keys=STRING|"{ENTER}"
sendkind=STRING|"0"
wincaption=STRING|"sbterm"

[Actions\Action4]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 200 ms"
Params=FOLDER

[Actions\Action4\Params]
delay=STRING|"2"

[Actions\Action5]
ActionID=STRING|"A_CLIPBOARD_COPY"
Enabled=INTEGER|-1
Name=STRING|"Copy"
Params=FOLDER

[Actions\Action5\Params]
mode=STRING|"1"

[Actions\Action6]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 200 ms"
Params=FOLDER

[Actions\Action6\Params]
delay=STRING|"2"

[Actions\Action7]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to ""sbterm"""
Params=FOLDER

[Actions\Action7\Params]
currentwindow=STRING|"0"
fixedwindow=STRING|"0"
keylayout=STRING|"0"
keys=STRING|"{ENTER}"
sendkind=STRING|"0"
wincaption=STRING|"sbterm"

[Actions\Action8]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 200 ms"
Params=FOLDER

[Actions\Action8\Params]
delay=STRING|"2"

[Actions\Action9]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create variable ""WAGA1"" with value ""{ClipBoardContent}"""
Params=FOLDER

[Actions\Action9\Params]
expand=STRING|"0"
varname=STRING|"WAGA1"
varvalue=STRING|"{ClipBoardContent}"

[Events]
Event1=FOLDER

[Events\Event1]
Enabled=INTEGER|-1
EventID=STRING|"E_GENERAL_HOTKEY"
Params=FOLDER

[Events\Event1\Params]
hotkey=STRING|"32884"
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

operations on variables

Post by Oleg »

I wish only one another thing. On first step of task robotask thisplays a question form "how many times repeat this task ?" I am inputing eg. 3 and robotask perform this task three times. Is it possible to do using loops ?
Yes, this if possible.

See the example below:
;*****************************
;* RoboTask Task file       
;* Do not edit in text editor!
;*****************************

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1746330413
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task591"
Hide=INTEGER|0
ID=INTEGER|694059753
Name=STRING|"repeat"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER

[Actions\Action1]
ActionID=STRING|"A_DIALOG_INPUTBOX"
Enabled=INTEGER|-1
Name=STRING|"Input Box"
Params=FOLDER

[Actions\Action1\Params]
default=STRING|"0"
prompt=STRING|"How many times to repeat?"
variable=STRING|"RPT"

[Actions\Action2]
ActionID=STRING|"A_LOOP_SIMPLE"
Enabled=INTEGER|-1
Name=STRING|"Simple Loop"
Params=FOLDER

[Actions\Action2\Params]
begin=STRING|"1"
end=STRING|"{rpt}"

[Actions\Action3]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""[{Time}, {DayOfWeek}, {Date}]"""
Params=FOLDER

[Actions\Action3\Params]
icon=STRING|"1"
msg0=STRING|"[{Time}, {DayOfWeek}, {Date}]"
msg1=STRING|"Hey, awake!"
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action4]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
tombur
Posts: 24
Joined: Mon Aug 25, 2008 11:59 pm

operations on variables

Post by tombur »

changes you have made in task are working. now I am working with that loop.Thank You very very much.
Last edited by tombur on Thu Aug 28, 2008 8:23 am, edited 1 time in total.
tombur
Posts: 24
Joined: Mon Aug 25, 2008 11:59 pm

operations on variables

Post by tombur »

It's done and working perfect. Thank You very much for Your kind help.
tombur
Posts: 24
Joined: Mon Aug 25, 2008 11:59 pm

operations on variables

Post by tombur »

There is another function I want. Only one, the last one. I wish that after step 'copy to clipboard' if nothing is copied the task will send other keystrokes to application and stops. Now it is sending the keystrokes anyway. I have made this changes in task but it does not work. I have messed up something;*****************************;* RoboTask Task file         ;* Do not edit in text editor!;***************************** [Root]ActionAfterRun=INTEGER|0Actions=FOLDERAutomat=INTEGER|-1CatID=INTEGER|1981091247ContinueOnError=INTEGER|0Events=FOLDERExternalName=STRING|"Task1"Hide=INTEGER|0ID=INTEGER|1241965760Name=STRING|"UPUST 0.5 - nowy terminal"Priority=INTEGER|3RunOnClose=INTEGER|0RunOnStartup=INTEGER|0ToLog=INTEGER|3WriteGeneralLog=INTEGER|0[Actions]Action1=FOLDERAction10=FOLDERAction11=FOLDERAction12=FOLDERAction13=FOLDERAction14=FOLDERAction15=FOLDERAction16=FOLDERAction17=FOLDERAction18=FOLDERAction19=FOLDERAction2=FOLDERAction20=FOLDERAction21=FOLDERAction22=FOLDERAction23=FOLDERAction24=FOLDERAction25=FOLDERAction26=FOLDERAction27=FOLDERAction28=FOLDERAction29=FOLDERAction3=FOLDERAction30=FOLDERAction31=FOLDERAction4=FOLDERAction5=FOLDERAction6=FOLDERAction7=FOLDERAction8=FOLDERAction9=FOLDER[Actions\Action1]ActionID=STRING|"A_DIALOG_INPUTBOX"Enabled=INTEGER|-1Name=STRING|"Input Box"Params=FOLDER[Actions\Action1\Params]default=STRING|"0"prompt=STRING|"ZOSTANIE ODJÊTY UPUST 0.5 % - ILE RAZY MAM WYKONAÆ ?"variable=STRING|"RPT"[Actions\Action10]ActionID=STRING|"A_FLOW_ELSE"Enabled=INTEGER|-1Name=STRING|"Else"[Actions\Action11]ActionID=STRING|"A_GENERAL_PAUSE"Enabled=INTEGER|-1Name=STRING|"Delay 200 ms"Params=FOLDER[Actions\Action11\Params]delay=STRING|"2"[Actions\Action12]ActionID=STRING|"A_GENERAL_SENDKEYS"Enabled=INTEGER|-1Name=STRING|"Send keys to ""terminal"""Params=FOLDER[Actions\Action12\Params]currentwindow=STRING|"0"fixedwindow=STRING|"0"keylayout=STRING|"0"keys=STRING|"{ENTER}"sendkind=STRING|"0"wincaption=STRING|"terminal"[Actions\Action13]ActionID=STRING|"A_GENERAL_PAUSE"Enabled=INTEGER|-1Name=STRING|"Delay 200 ms"Params=FOLDER[Actions\Action13\Params]delay=STRING|"2"[Actions\Action14]ActionID=STRING|"A_VARIABLES_CREATE"Enabled=INTEGER|-1Name=STRING|"Create variable ""WAGA1"" with value ""{ClipBoardContent}"""Params=FOLDER[Actions\Action14\Params]expand=STRING|"0"varname=STRING|"WAGA1"varvalue=STRING|"{ClipBoardContent}"[Actions\Action15]ActionID=STRING|"A_VARIABLES_CREATE"Enabled=INTEGER|-1Name=STRING|"Create variable ""UPUST"" with value """""Params=FOLDER[Actions\Action15\Params]expand=STRING|"0"varname=STRING|"UPUST"[Actions\Action16]ActionID=STRING|"A_VARIABLES_CREATE"Enabled=INTEGER|-1Name=STRING|"Create variable ""WAGA2"" with value """""Params=FOLDER[Actions\Action16\Params]expand=STRING|"0"varname=STRING|"WAGA2"[Actions\Action17]ActionID=STRING|"BASIC_EVALUATE"Enabled=INTEGER|-1Name=STRING|"Evaluate"Params=FOLDER[Actions\Action17\Params]expression=STRING|"replace(""{WAGA1}"","","",""."")"variable=STRING|"{WAGA1}"[Actions\Action18]ActionID=STRING|"BASIC_EVALUATE"Enabled=INTEGER|-1Name=STRING|"Evaluate"Params=FOLDER[Actions\Action18\Params]expression=STRING|"{WAGA1}*0.005"variable=STRING|"{UPUST}"[Actions\Action19]ActionID=STRING|"BASIC_EVALUATE"Enabled=INTEGER|-1Name=STRING|"Evaluate"Params=FOLDER[Actions\Action19\Params]expression=STRING|"{WAGA1}-{UPUST}"variable=STRING|"{WAGA2}"[Actions\Action2]ActionID=STRING|"A_LOOP_SIMPLE"Enabled=INTEGER|-1Name=STRING|"Simple Loop"Params=FOLDER[Actions\Action2\Params]begin=STRING|"1"end=STRING|"{rpt}"[Actions\Action20]ActionID=STRING|"A_CLIPBOARD_CLEAR"Enabled=INTEGER|-1Name=STRING|"Clear Clipboard"[Actions\Action21]ActionID=STRING|"A_CLIPBOARD_PUT"Enabled=INTEGER|-1Name=STRING|"Put Text"Params=FOLDER[Actions\Action21\Params]line0=STRING|"{WAGA2}"linecount=STRING|"1"sourcetext=STRING|"1"[Actions\Action22]ActionID=STRING|"A_VARIABLES_REMOVE"Enabled=INTEGER|-1Name=STRING|"Remove variable ""WAGA1"""Params=FOLDER[Actions\Action22\Params]varname=STRING|"WAGA1"[Actions\Action23]ActionID=STRING|"A_VARIABLES_REMOVE"Enabled=INTEGER|-1Name=STRING|"Remove variable ""WAGA2"""Params=FOLDER[Actions\Action23\Params]varname=STRING|"WAGA2"[Actions\Action24]ActionID=STRING|"A_VARIABLES_REMOVE"Enabled=INTEGER|-1Name=STRING|"Remove variable ""UPUST"""Params=FOLDER[Actions\Action24\Params]varname=STRING|"UPUST"[Actions\Action25]ActionID=STRING|"A_GENERAL_SENDKEYS"Enabled=INTEGER|-1Name=STRING|"Send keys to ""terminal"""Params=FOLDER[Actions\Action25\Params]currentwindow=STRING|"0"fixedwindow=STRING|"0"keylayout=STRING|"0"keys=STRING|"{ENTER}"sendkind=STRING|"0"wincaption=STRING|"terminal"[Actions\Action26]ActionID=STRING|"A_GENERAL_PAUSE"Enabled=INTEGER|-1Name=STRING|"Delay 200 ms"Params=FOLDER[Actions\Action26\Params]delay=STRING|"2"[Actions\Action27]ActionID=STRING|"A_CLIPBOARD_PASTE"Enabled=INTEGER|-1Name=STRING|"Paste"Params=FOLDER[Actions\Action27\Params]mode=STRING|"1"[Actions\Action28]ActionID=STRING|"A_CLIPBOARD_CLEAR"Enabled=INTEGER|-1Name=STRING|"Clear Clipboard"[Actions\Action29]ActionID=STRING|"A_GENERAL_SENDKEYS"Enabled=INTEGER|-1Name=STRING|"Send keys to ""terminal"""Params=FOLDER[Actions\Action29\Params]currentwindow=STRING|"0"fixedwindow=STRING|"0"keylayout=STRING|"0"keys=STRING|"{DOWN}"sendkind=STRING|"0"wincaption=STRING|"terminal"[Actions\Action3]ActionID=STRING|"A_CLIPBOARD_CLEAR"Enabled=INTEGER|-1Name=STRING|"Clear Clipboard"[Actions\Action30]ActionID=STRING|"A_FLOW_ENDIF"Enabled=INTEGER|-1Name=STRING|"End If"[Actions\Action31]ActionID=STRING|"A_LOOP_END"Enabled=INTEGER|-1Name=STRING|"End Loop"[Actions\Action4]ActionID=STRING|"A_GENERAL_SENDKEYS"Enabled=INTEGER|-1Name=STRING|"Send keys to ""terminal"""Params=FOLDER[Actions\Action4\Params]currentwindow=STRING|"0"fixedwindow=STRING|"0"keylayout=STRING|"0"keys=STRING|"{ENTER}"sendkind=STRING|"0"wincaption=STRING|"terminal"[Actions\Action5]ActionID=STRING|"A_GENERAL_PAUSE"Enabled=INTEGER|-1Name=STRING|"Delay 200 ms"Params=FOLDER[Actions\Action5\Params]delay=STRING|"2"[Actions\Action6]ActionID=STRING|"A_CLIPBOARD_COPY"Enabled=INTEGER|-1Name=STRING|"Copy"Params=FOLDER[Actions\Action6\Params]mode=STRING|"1"[Actions\Action7]ActionID=STRING|"A_FLOW_IF"Enabled=INTEGER|-1Name=STRING|"If Then"Params=FOLDER[Actions\Action7\Params]case=STRING|"0"operator=STRING|"7"type=STRING|"0"value1=STRING|"{ClipBoardContent}"value2=STRING|"0"[Actions\Action8]ActionID=STRING|"A_GENERAL_PAUSE"Enabled=INTEGER|-1Name=STRING|"Delay 200 ms"Params=FOLDER[Actions\Action8\Params]delay=STRING|"2"[Actions\Action9]ActionID=STRING|"A_GENERAL_SENDKEYS"Enabled=INTEGER|-1Name=STRING|"Send keys to ""terminal"""Params=FOLDER[Actions\Action9\Params]currentwindow=STRING|"0"fixedwindow=STRING|"0"keylayout=STRING|"0"keys=STRING|"{ESCAPE}"sendkind=STRING|"0"wincaption=STRING|"terminal"[Events]Event1=FOLDER[Events\Event1]Enabled=INTEGER|-1EventID=STRING|"E_GENERAL_HOTKEY"Params=FOLDER[Events\Event1\Params]hotkey=STRING|"32884"Can You help me with this ? There is nothing else I want. I promise
Post Reply