Check for filenames with spaces (File Monitor)

Discuss RoboTask here
Post Reply
Rukbunker
Posts: 156
Joined: Mon Feb 22, 2016 4:06 pm
Location: Netherlands

Check for filenames with spaces (File Monitor)

Post by Rukbunker »

Hey Oleg,

I want to trigger a task with File Monitor, but only when the filenames contain (a) space(s). They should be replaced in the task itself. I've tried a with * *.* and also this didn't work:
Knipsel.PNG
Knipsel.PNG (16.77 KiB) Viewed 267 times
In the example above, it triggers on anything. What can you adivse me?
Oleg
Site Admin
Posts: 2811
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Check for filenames with spaces (File Monitor)

Post by Oleg »

You must use the mask in quotes, like this

Code: Select all

"* *.*"
You can specify several search masks as comma-separated string. Standard comma-separated string means that if any element contains spaces, it must be enclosed in quotation marks.

Also look at my simple example. It monitors files with spaces only

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|265541000
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task14"
Hide=INTEGER|0
ID=INTEGER|934778895
LogOnAsUser=INTEGER|1
Name=STRING|"Monitor files with spaces"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER

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

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

[Events]
Event1=FOLDER

[Events\Event1]
Enabled=INTEGER|-1
EventID=STRING|"E_FILE_MONITOR"
Name=STRING|"File Monitor"
Params=FOLDER
UniqueID=INTEGER|1856915451

[Events\Event1\Params]
chg=STRING|"1"
chga=STRING|"1"
chgsl=STRING|"1"
chgsm=STRING|"1"
chgtl=STRING|"1"
chgtm=STRING|"1"
del=STRING|"1"
folder1=STRING|"D:\temp\Folder with - space"
foldercount=STRING|"1"
incmask=STRING|"""* *.*"""
interval=STRING|"3"
listmode=STRING|"1"
mon_files=STRING|"1"
mon_folders=STRING|"0"
new=STRING|"1"
notsavestatus=STRING|"0"
pass=STRING|"0"
passmode=STRING|"1"
required=STRING|"0"
saveresults=STRING|"0"
subfolders1=STRING|"0"

Oleg Yershov
Rukbunker
Posts: 156
Joined: Mon Feb 22, 2016 4:06 pm
Location: Netherlands

Re: Check for filenames with spaces (File Monitor)

Post by Rukbunker »

Great, that did the trick! Many thanks!
Post Reply