AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

WatchDirectory()
Goto page Previous  1, 2, 3, 4  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4647
Location: AHK Forum

PostPosted: Fri Jul 03, 2009 8:49 pm    Post subject: Reply with quote

Roland wrote:
Hi HotKeyIt,

Thanks for the great function.

I think I found a bug in the new function.

Code:
If (Dir%r%T!="")
   SetTimer,TimerDirectoryChanges, %T%


should be

Code:
If (Dir%r%T!="")
   SetTimer,TimerDirectoryChanges, % Dir%r%T


It seems %T% is blank and therefore the timer is always created with the default (250 ms).

Many thanks Roland, I have corrected this Wink
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
e1miran



Joined: 17 Apr 2009
Posts: 9
Location: Tampa, FL

PostPosted: Tue Oct 13, 2009 2:29 pm    Post subject: Reply with quote

Great script. However, I'm having trouble getting it to detect anything on a network drive here at work.

I've tried both scripts (initial one and the revised with more options) and both work fine monitoring a directory on my local machine. But when I try to monitor a directory such as "\\10.202.0.150\vol1\SHARED"... nothing. This is a shared directory on the server here at work. Any ideas?
Back to top
View user's profile Send private message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4647
Location: AHK Forum

PostPosted: Tue Oct 13, 2009 6:34 pm    Post subject: Reply with quote

e1miran wrote:
Great script. However, I'm having trouble getting it to detect anything on a network drive here at work.

I've tried both scripts (initial one and the revised with more options) and both work fine monitoring a directory on my local machine. But when I try to monitor a directory such as "\\10.202.0.150\vol1\SHARED"... nothing. This is a shared directory on the server here at work. Any ideas?


It works fine for me at home and work.
Try to map a network drive and see if that works?
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
Cristobal16
Guest





PostPosted: Fri Nov 20, 2009 3:49 pm    Post subject: Any way to have WatchDirectory display the modifying user? Reply with quote

This works great for me, but I would really like to be able to see which users do the modification / file creation. Is there any way that the user that modifies the file could pop up as part of the tooltip message? Thanks!
Back to top
Ender



Joined: 10 Apr 2009
Posts: 8
Location: Michigan, USA

PostPosted: Fri Nov 20, 2009 3:58 pm    Post subject: YES! Track users! Reply with quote

That is something I have been wondering about for a while too - is this possible? Please help!
_________________
This catacomb has got me by the throat.
--Sers, Depp. Ich will WORSCHT.--
----Tu madre tiene un bigote----
Back to top
View user's profile Send private message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4647
Location: AHK Forum

PostPosted: Fri Nov 20, 2009 4:36 pm    Post subject: Reply with quote

Try here, looks to be not easy and will not work for all files I think Smile
Using the Summary Information Stream (Windows) MSDN
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
sandman596



Joined: 10 Jul 2010
Posts: 4

PostPosted: Sat Jul 10, 2010 5:16 am    Post subject: Watchdirectory issues yet Reply with quote

OK, newbie here, but learning.

I cannot get past the static error no matter what I do. I have tried for several hours to figure out how to get this to monitor a directory but to no joy.

Can someone give exact instructions on what needs to be done, where and how to create the ahk file?

My ultimate goal is to monitor a directory with multiple subdirs. When a new image(s) is\are detected in one of the dirs, the script will rename the file based on part of the dir name and part of the original file name.

But to get to the renaming, I need to get the monitoring working first.

The new file the is incoming will have the same prefix, so it can be easily searched/filtered for.

Any help would be greatly appreciated.
Back to top
View user's profile Send private message
Guest






PostPosted: Sat Jul 10, 2010 8:29 am    Post subject: Re: Watchdirectory issues yet Reply with quote

sandman596 wrote:
I cannot get past the static error no matter what I do.
What is "the static error"? I can only guess you're trying to run the script on a rather old version of AutoHotkey which does not support assume-static. In that case, upgrade to a more recent version of AutoHotkey.
Code:
if A_AhkVersion < 1.0.48
    MsgBox You'd better upgrade!
Back to top
jackchen



Joined: 18 Jul 2010
Posts: 4
Location: China

PostPosted: Sun Jul 18, 2010 1:22 am    Post subject: Reply with quote

I tried both FolderSpy and WatchDirectory(),neither supprots file names or folder names in Chinese.This function reports only partial file name or folder name,the rest of the name are missed.I guess the script does not support Unicode characters.

I dont understand API at all,can someone point out the problem and give me a solution?[/img]
Back to top
View user's profile Send private message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4647
Location: AHK Forum

PostPosted: Sun Jul 18, 2010 10:29 am    Post subject: Reply with quote

Can you try this one WatchDir_AHK_H.ahk.
You will need to use AutoHotkey_H
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
jackchen



Joined: 18 Jul 2010
Posts: 4
Location: China

PostPosted: Tue Jul 20, 2010 2:13 pm    Post subject: Reply with quote

HotKeyIt wrote:
Can you try this one WatchDir_AHK_H.ahk.
You will need to use AutoHotkey_H

It's too complex to me.I replaced AHK with AHK_H and tried to run Watchdir_AHK_H.ahk,but it didnt work.
I've made a script to monitor some new files by WatchDirectory() then add the file info into an index file.It works perfectly with files and folders in English,but fails in Chinese. I've asked for help in an AHK forum in China,unfortunately no one can solve the problem.

I dont understand DllCall as well as API,I suspected this line in WatchDirectory() was the key:
FileNameLen := NumGet( PointerFNI + 8 )
and changed it to:
FileNameLen := NumGet( PointerFNI + 32 )

Then it reported full file names in Chinese,while other problems occured.Sometimes the reported file name lapped over previous one...
Back to top
View user's profile Send private message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4647
Location: AHK Forum

PostPosted: Tue Jul 20, 2010 7:27 pm    Post subject: Reply with quote

If you copy the filename into clipboard and run MsgBox % Clipboard, can you see the name displayed correctly, btw. what encoding is it?
Can you upload an empty text file named in Chinese so I can use it as example?
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
jackchen



Joined: 18 Jul 2010
Posts: 4
Location: China

PostPosted: Wed Jul 21, 2010 4:45 am    Post subject: Reply with quote

Quote:
If you copy the filename into clipboard and run MsgBox % Clipboard, can you see the name displayed correctly, btw. what encoding is it?Can you upload an empty text file named in Chinese so I can use it as example?

MsgBox displays filename in clipboard correctly.
WatchDirectory() reports incorrect filename as below.The last chararcter and the Ext .txt are missing.

The files for test:
http://www.autohotkey.net/~jackchen/Test_Chinese.zip
including a test script and text files named in Chinese.
Back to top
View user's profile Send private message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4647
Location: AHK Forum

PostPosted: Wed Jul 21, 2010 7:31 pm    Post subject: Reply with quote

Can you try again this one, just double click WatchDirectory.exe (renamed AutoHotkey_H.exe) and do some changes to your files.
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
jackchen



Joined: 18 Jul 2010
Posts: 4
Location: China

PostPosted: Fri Jul 23, 2010 9:54 am    Post subject: Reply with quote

HotKeyIt wrote:
Can you try again this one, just double click WatchDirectory.exe (renamed AutoHotkey_H.exe) and do some changes to your files.

This one works.Thanks.
Sorry HotKeyIt,I found I've made a mistake.I tested WatchDir_AHK_H.ahk with AutoHotkey_H ReleaseA couple days ago and got wrong report.I tested it again just now with ReleaseU,it reported correctly!
But it seems that WatchDir_AHK_H.ahk is a little bit more complex...
And I find my script,which consists of near 1000 lines,does not work with AutoHotkey_H. I 'm not capable to change it to be compatible with AutoHotkey_H...
I was wondering if it's possible to make a little change to WatchDirectory and let it work with Chinese with original AutoHotkey?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group