WatchFolder() - updated on 2021-10-14
Re: WatchFolder()
Damn it...It is freaking useful !
Re: WatchFolder()
It is executing callback function twice for me. WatchFolder("C:\Apps\file", "sdasd", false, 16). Any idea why it is happening?
Re: WatchFolder()
Called twice with the same action for the same file? Also, what is causing the change of the file times?
Re: WatchFolder()
WatchFolder("C:\Videos", "MyUserFunc"), WatchFolder("C:\Music", "MyUserFunc")
The second folder doesnt work!
The second folder doesnt work!
Re: WatchFolder() - updated on 2016-03-14
Hi DocMAX,
I found a bug and fixed it!
Thanks for reporting and your persistency!
I found a bug and fixed it!
Thanks for reporting and your persistency!
Re: WatchFolder() - updated on 2016-03-14
thank you / danke!
Re: WatchFolder() - updated on 2016-03-14
Sorry! I completely forgot to check this thread.
> Called twice with the same action for the same file? Also, what is causing the change of the file times?
I think yes. If I modified content of a file and save it once, it was raising event twice for some unknown reasons. I used it long time ago, so I am not very sure either.
I ended up using a timer to record event time and ignoring the very frequent ones.
> Called twice with the same action for the same file? Also, what is causing the change of the file times?
I think yes. If I modified content of a file and save it once, it was raising event twice for some unknown reasons. I used it long time ago, so I am not very sure either.
I ended up using a timer to record event time and ignoring the very frequent ones.
Re: WatchFolder() - updated on 2016-03-14
There seems to be a leak in the "**END" section. The handle isn't closed appropriately here:
D is the key in the above code, and D.Handle is always null. The handle is actually stored as a subkey on the value - so it should rather be something like:
Other than that, thanks for sharing. This was very useful.
Code: Select all
For D In WatchedFolders
If D Is Not Integer
DllCall("CloseHandle", "Ptr", D.Handle)
Code: Select all
For key, D In WatchedFolders
If key Is Not Integer
DllCall("CloseHandle", "Ptr", D.Handle)
Re: WatchFolder() - updated on 2016-03-14
Thanks egocarib, you're right. It will be fixed soon.
Re: WatchFolder() - updated on 2016-11-30
Fixed! Thanks again!
Re: WatchFolder() - updated on 2016-11-30
Thanks for the update! WatchFolder() is one the most useful scripts of all time.
Re: WatchFolder() - updated on 2016-11-30
I want to copy/move a file after it was written to some Folder. How can I make this script recognize if a file was completely written? Problem is, it moves the file and size is 0kb.. Thenks and best regards!
Re: WatchFolder() - updated on 2016-11-30
Isn't the file reported twice, once as 'added' and once as 'modified'?
Re: WatchFolder() - updated on 2016-11-30
Hi "just me"
I only get following Action IDs:
1
2
4
Modified has to be "3".. Thanks for help
I only get following Action IDs:
1
2
4
Modified has to be "3".. Thanks for help
Re: WatchFolder() - updated on 2016-11-30
What do you get if you don't move the file after action 1 (added) in case the file's size is zero?
Re: WatchFolder() - updated on 2016-11-30
I don't move it anymore while testing.. If I create an empty Word doc I get:
"1" (word doc added)
Then I open it and get another
"1" (temporary file added)
Then I type something and save the document I get:
"1"
"4"
"4"
"2"
Then I Close the document and get:
"2" (temporary file deleted)
I couldn't get a "3", whatever I try..
"1" (word doc added)
Then I open it and get another
"1" (temporary file added)
Then I type something and save the document I get:
"1"
"4"
"4"
"2"
Then I Close the document and get:
"2" (temporary file deleted)
I couldn't get a "3", whatever I try..
Re: WatchFolder() - updated on 2016-11-30
Small example:
- I create a new *.docx (right click in Folder, New..) -> "1" (doc added)
- I open the *.docx -> "1" (temp file created)
- I type something and hit save -> "1", "4", "4", "2"
- I Close it -> "2" (temp file deleted)
No matter what I try, couldn't get a "3".. :/
Edit:
Sorry for double post, didn't realize that it had to be approved by a mod..
- I create a new *.docx (right click in Folder, New..) -> "1" (doc added)
- I open the *.docx -> "1" (temp file created)
- I type something and hit save -> "1", "4", "4", "2"
- I Close it -> "2" (temp file deleted)
No matter what I try, couldn't get a "3".. :/
Edit:
Sorry for double post, didn't realize that it had to be approved by a mod..
Re: WatchFolder() - updated on 2016-11-30
Which options do you pass to WatchFolder() in Watch?
Re: WatchFolder() - updated on 2016-11-30
Hi there.
I was wondering if someone can help me understand how to make a small modification to this wonderful script!
I'd like to be able to watch for 2 file types (*.mobi and *.epub) in the defined watch folder.
I have the script running but no idea how to add a condition to only watch for those two file types?
Does anyone have any suggestions and a copy snippet they could share? I'm learning and this function would be a huge help and very instructive!
Many thanks
R
I was wondering if someone can help me understand how to make a small modification to this wonderful script!
I'd like to be able to watch for 2 file types (*.mobi and *.epub) in the defined watch folder.
I have the script running but no idea how to add a condition to only watch for those two file types?
Does anyone have any suggestions and a copy snippet they could share? I'm learning and this function would be a huge help and very instructive!
Many thanks
R
Re: WatchFolder() - updated on 2016-11-30
So you have to check the file extensions within the UserFunction.WatchFolder wrote:Disadvantages (objective):
- No filter options.
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: Chunjee and 100 guests