"WAIT FOR FILE" => File doesn't exist.

Discuss RoboTask here
Post Reply
userXXX
Posts: 58
Joined: Wed Jun 11, 2014 8:45 am

"WAIT FOR FILE" => File doesn't exist.

Post by userXXX »

What could be the reason for getting a "File doesn't exist."-error when using the "WAIT FOR FILE" action?
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: "WAIT FOR FILE" => File doesn't exist.

Post by Oleg »

Wait for File action waits until the selected file will be available for some operations.
If file doesn't exist the nothing to wait. This is error.

see the example how to process such situation:

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1663346572
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task26"
Hide=INTEGER|0
ID=INTEGER|1547760231
LogOnAsUser=INTEGER|1
Name=STRING|"wait for file example"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
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 ""FILENAME"" with value ""d:\temp\nofile.txt"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"FILENAME"
varvalue=STRING|"d:\temp\nofile.txt"

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

[Actions\Action2\Params]
case=STRING|"0"
connection=STRING|"0"
count=STRING|"1"
operator=STRING|"0"
type=STRING|"3"
value1=STRING|"{FileExists({filename})}"

[Actions\Action3]
ActionID=STRING|"A_FILE_WAIT"
Enabled=INTEGER|-1
Name=STRING|"Waiting {filename} file for 60 sec"
Params=FOLDER

[Actions\Action3\Params]
filename=STRING|"{filename}"
timeout=STRING|"60"

[Actions\Action4]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""File {FileName} is free"""
Params=FOLDER

[Actions\Action4\Params]
icon=STRING|"1"
msg0=STRING|"File {FileName} is free"
msgcount=STRING|"1"
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 ""File ""{FileName}"" doesn't exist"""
Params=FOLDER

[Actions\Action6\Params]
icon=STRING|"0"
msg0=STRING|"File ""{FileName}"" doesn't exist"
msgcount=STRING|"1"
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 to a file and use menu Task->Import to import the task into RoboTask.
Oleg Yershov
userXXX
Posts: 58
Joined: Wed Jun 11, 2014 8:45 am

Re: "WAIT FOR FILE" => File doesn't exist.

Post by userXXX »

Hello Oleg,

thank you.

I see, this is not the functionality I'm looking for.

My scenario is:
Task A has to wait until Task B has created a file (Task A knows path and name of the file). Task A cannot wait until Task B has finished, so it has to wait for the file.

Any idea?
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: "WAIT FOR FILE" => File doesn't exist.

Post by Oleg »

See the example below.
This task waits for file appearance during 1 minute
Maybe it's necessary to make such action later (or modify Wait For File action).

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1663346572
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task30"
Hide=INTEGER|0
ID=INTEGER|669997716
LogOnAsUser=INTEGER|1
Name=STRING|"wait for file appearance"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action13=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""FILENAME"" with value ""d:\temp\nofile.txt"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"FILENAME"
varvalue=STRING|"d:\temp\nofile.txt"

[Actions\Action10]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""File {FileName} exists"""
Params=FOLDER

[Actions\Action10\Params]
icon=STRING|"1"
msg0=STRING|"File {FileName} exists"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

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

[Actions\Action12]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""File ""{FileName}"" doesn't exist"""
Params=FOLDER

[Actions\Action12\Params]
icon=STRING|"0"
msg0=STRING|"File ""{FileName}"" doesn't exist"
msg1=STRING|"Timeout is over"
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action13]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

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

[Actions\Action2\Params]
begin=STRING|"1"
end=STRING|"60"

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

[Actions\Action3\Params]
case=STRING|"0"
connection=STRING|"0"
count=STRING|"1"
operator=STRING|"0"
type=STRING|"3"
value1=STRING|"{FileExists({filename})}"

[Actions\Action4]
ActionID=STRING|"A_LOOP_BREAK"
Enabled=INTEGER|-1
Name=STRING|"Break"

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

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

[Actions\Action6\Params]
delay=STRING|"1"
dimension=STRING|"1"

[Actions\Action7]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action8]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

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

[Actions\Action9\Params]
case=STRING|"0"
connection=STRING|"0"
count=STRING|"1"
operator=STRING|"0"
type=STRING|"3"
value1=STRING|"{FileExists({filename})}"

Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.
Oleg Yershov
userXXX
Posts: 58
Joined: Wed Jun 11, 2014 8:45 am

Re: "WAIT FOR FILE" => File doesn't exist.

Post by userXXX »

Thank you, Oleg.
Post Reply