Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
File Trigger Cannot Monitor Files in Subfolders
#1
I need to monitor files inside a folder named T on the desktop.
If I drag and drop a folder named A (which contains a file named A.txt) into the T folder, the trigger does not work. Nothing is displayed in the Output panel, and neither the trigger type nor the file path is reported.
The following video demonstrates the issue.

[Image: demo.gif]
#2
1. QM bug - somehow file triggers don't work when the filename length is < 3.

2. QM triggers use the logic of the used Windows API. When a folder added, we have a notification for that folder only, not for files in it. Workaround: Let the script trigger include all files and folders; then enumerate files.

Function File_trigger_files_in_added_folder
Trigger $f 0xC07 "C:\Test"     Help - how to add the trigger to the macro
Code:
Copy      Help
;\
function event $name [$newname]
;event: 1 added, 2 removed, 4 renamed, 8 modified
out F"{event} {name}"

if event=1 ;;added
,if FileExists(name 2)=2 ;;folder
,,Dir d
,,foreach(d F"{name}\*.txt" FE_Dir 4) ;;enum descendant txt files
,,,str path=d.FullPath
,,,out path
,,
,,
#3
Thanks for your help.
I tested the trigger code above, but it still doesn't work.
#4
The trigger is changed too, not only code.


Forum Jump:


Users browsing this thread: 1 Guest(s)