Page 1 of 1
Confused about If-Then. Please help
Posted: Mon Mar 24, 2014 4:00 am
by misery
Hi, I'm new to RoboTask and have the following issue. My task has an action step of highlighting a string of text from a website, and then (CTRL+C) to copy. I want to use the IF-THEN command to check
IF this copied string of text contains the word "roof"
THEN remove roof from the string before I paste it with the next step of the task.
I've read the manual but don't understand what First/Second operand are in my situation, or where I set up the IF-THEN function relative to my other steps in my task.
Please help. Thanks in advance
Re: Confused about If-Then. Please help
Posted: Mon Mar 24, 2014 11:12 am
by Oleg
The action
"If..Then" compares two values: 1-st operand and 2-nd operand
See the example below:
Code: Select all
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|317955339
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task413"
Hide=INTEGER|0
ID=INTEGER|154462611
LogOnAsUser=INTEGER|1
Name=STRING|"Create local variable ""FULLSTRING"" with value ""We want to find the word ""roof"" in the string""..."
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""FULLSTRING"" with value ""We want to find the word ""roof"" in the string"""
Params=FOLDER
[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"FULLSTRING"
varvalue=STRING|"We want to find the word ""roof"" in the string"
[Actions\Action2]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""SUBSTRING"" with value ""roof"""
Params=FOLDER
[Actions\Action2\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"SUBSTRING"
varvalue=STRING|"roof"
[Actions\Action3]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER
[Actions\Action3\Params]
case=STRING|"0"
operator=STRING|"6"
type=STRING|"0"
value1=STRING|"{SubString}"
value2=STRING|"{FullString}"
[Actions\Action4]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""The word ""{SubString}"" is found in the string"""
Params=FOLDER
[Actions\Action4\Params]
icon=STRING|"1"
msg0=STRING|"The word ""{SubString}"" is found in the string"
msg1=STRING|"""{FullString}"""
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"
[Actions\Action5]
ActionID=STRING|"A_FLOW_ELSE"
Enabled=INTEGER|-1
Name=STRING|"Else"
[Actions\Action6]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""The word ""{SubString}"" is not found in the string"""
Params=FOLDER
[Actions\Action6\Params]
icon=STRING|"3"
msg0=STRING|"The word ""{SubString}"" is not found in the string"
msg1=STRING|"""{FullString}"""
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"
[Actions\Action7]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
Save the text of the task into a file and use menu Task->Import to import the task into RoboTask.