IF/Then Task

Discuss RoboTask here
Post Reply
batesm0t3l
Posts: 2
Joined: Tue Sep 23, 2014 3:28 pm

IF/Then Task

Post by batesm0t3l »

Hello.

Ive just bought RoboTask and I am starting to learn through the examples etc.

However, I was wondering can someone help me in how I would create an IF/Then Task to test that a Windows Drive letter exists.

Id much appreciate the help till I get up to speed.

Thank you.


M.
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: IF/Then Task

Post by Oleg »

Look at this example:

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|933306365
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task1015"
Hide=INTEGER|0
ID=INTEGER|2144471300
LogOnAsUser=INTEGER|1
Name=STRING|"Check drive"
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

[Actions\Action1]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action1\Params]
case=STRING|"0"
operator=STRING|"7"
type=STRING|"0"
value1=STRING|"{TotalDiskSpace(i:\)}"

[Actions\Action2]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Drive I: desn't exist"""
Params=FOLDER

[Actions\Action2\Params]
icon=STRING|"0"
msg0=STRING|"Drive I: desn't exist"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action3]
ActionID=STRING|"A_FLOW_ELSE"
Enabled=INTEGER|-1
Name=STRING|"Else"

[Actions\Action4]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Drive I: found"""
Params=FOLDER

[Actions\Action4\Params]
icon=STRING|"1"
msg0=STRING|"Drive I: found"
msg1=STRING|"Total space = {TotalDiskSpace(i:\)}"
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action5]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
Use system variable {TotalDiskSpace(i:\)}
If drive doesn't exists this variable returns empty string.
Otherwise it returns number value.

Save the text of the task into a file and use menu Task->Import to import the task into RoboTask.
Oleg Yershov
batesm0t3l
Posts: 2
Joined: Tue Sep 23, 2014 3:28 pm

Re: IF/Then Task

Post by batesm0t3l »

Thank you.
Post Reply