Hello,
file monitor is working fine and the task starts immediately after a new file was copied into a folder.
My question:
How can I access the filename of the new file inside the task?
I tried this way but {L_TEST} is always empty inside the task:
Any suggestions?
Thank you.
Get filename of file which triggered file monitor
Re: Get filename of file which triggered file monitor
Look at my example below
In your example I see that you pass only the list of NEW files. Maybe the problem is here?
These parameters contains the list of files as text: one name per line
Code: Select all
;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|317955339
Comment=STRINGLIST
ContinueOnError=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task1285"
Hide=INTEGER|0
ID=INTEGER|118615438
LogOnAsUser=INTEGER|1
Name=STRING|"File monitoir with parameter"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
[Actions\Action1]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""New files are:"""
Params=FOLDER
[Actions\Action1\Params]
icon=STRING|"1"
msg0=STRING|"New files are:"
msg1=STRING|"{newfiles}"
msg3=STRING|"Deleted files are:"
msg4=STRING|"{delfiles}"
msg6=STRING|"Changed files:"
msg7=STRING|"{chfiles}"
msgcount=STRING|"8"
playsound=STRING|"0"
showmessage=STRING|"1"
[Events]
Event1=FOLDER
[Events\Event1]
Enabled=INTEGER|-1
EventID=STRING|"E_FILE_MONITOR"
Params=FOLDER
UnigueID=INTEGER|16445953
[Events\Event1\Params]
chg=STRING|"1"
chga=STRING|"1"
chglistparameter=STRING|"chfiles"
chgsl=STRING|"1"
chgsm=STRING|"1"
chgtl=STRING|"1"
chgtm=STRING|"1"
del=STRING|"1"
dellistparameter=STRING|"delfiles"
folder1=STRING|"d:\dest"
foldercount=STRING|"1"
incmask=STRING|"*.*"
interval=STRING|"5"
listmode=STRING|"1"
mon_files=STRING|"1"
mon_folders=STRING|"0"
new=STRING|"1"
newlistparameter=STRING|"newfiles"
pass=STRING|"1"
passmode=STRING|"2"
saveresults=STRING|"0"
subfolders1=STRING|"1"
These parameters contains the list of files as text: one name per line
Oleg Yershov
Re: Get filename of file which triggered file monitor
Thank you, Oleg.
>>In your example I see that you pass only the list of NEW files. Maybe the problem is here?
No, this works fine.
The reason was:
I additionally declared these parameters as local variables, too.
No good idea...
>>In your example I see that you pass only the list of NEW files. Maybe the problem is here?
No, this works fine.
The reason was:
I additionally declared these parameters as local variables, too.
No good idea...

Re: Get filename of file which triggered file monitor
You do not need to declare variables. It's enough to pass some parameters and you can use them as variables.additionally declared these parameters as local variables, too.
Oleg Yershov