AutoHotkey Community

It is currently May 27th, 2012, 1:39 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 57 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
PostPosted: October 2nd, 2010, 5:44 pm 
Offline

Joined: July 10th, 2010, 6:01 am
Posts: 4
I am trying to modify WatchDirectory to only report back to me the folders that files have been added to.

I am sorting my images into subfolders so that I can locate them easier and would like to get a list of the folders that images were sent.

I have it to the point where it only lists the directories, but I want it to list the directory only once. I cannot figure out how to filter the list to eliminate the multiples.

I have modified several other scripts to fit my other needs, but this one is kicking my butt.

Any help would be appreciated.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 2nd, 2010, 10:55 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Have you used this version?

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 8th, 2010, 7:15 pm 
Offline

Joined: February 23rd, 2006, 7:43 pm
Posts: 168
Location: Portugal
Hello HotkeyIT,

First let me congratulate you for the script that is very handy...

But... (and I'm writing because of a "but"... :P )

I'm using it for more than a year now, and this week, I've started to use the AHK_L version (Rev61) and I've noticed that the script isn't working anymore with this new version....

Code:
path = D:\Filmes & Series
WatchDirectory(path,1)
SetTimer, WatchFolder, 1000
Return

WatchFolder:
   WatchDirectory("ReportDirectoryChanges")
   ;~ SetTimer, WatchFolder, 1000
Return

ReportDirectoryChanges(Action,folder,file){
   static
   #1:="New File", #2:="Deleted", #3:="Modified", #4:="Renamed From", #5:="Renamed To"
   
   MsgBox, %Action%`n%folder%`n%file%
   return
}


This simple script on AHK version "AutoHotkey 1.0.48.05.exe" on the msgbox shows:
    4
    D:\Filmes & Series
    Futurama - S06E12 - The Mutants Are Revolting - HDTV.XviD-FQM.avi
and on AutoHotKeyL Rev61:
    4
    D:\Filmes & Series
    畆畴慲慭ⴠ匠㘰ㅅ′‭桔⁥畍慴瑮⁳牁⁥敒潶瑬湩⁧‭䑈噔堮楶ⵄ兆⹍癡彩


I've tried to find a solution but no luck so far... And as you might now this better than me, you might figure it out sooner than me...

Thx for the attention ;)

NOTE: I'm pretty sure that the problem is related to a DLL call that has changed because of the unicode, but can't figure it out... :S


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2010, 1:11 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
I've finally finished AHK_L/H version.

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2010, 4:34 am 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
Wow this is such a nice thing to do for us HKI!
much respect..

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2010, 7:27 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
I'm glad you like it :)

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 6th, 2011, 3:12 pm 
Offline

Joined: June 7th, 2007, 1:33 pm
Posts: 1019
hello

I want to create scripts that will monitor a specific folder and execute specific tasks when files appear/created in this folder, eg.:

- print the files with specific printer
- execute a cmd with specific parameters
- send an email with these files as attachments, to a specific recepient, with specific email subject (the subject is a variable)
- rename the files (pdf documents), using as filename, a specific regex match inside the document/pdf file
- write inside the files (doc documents), specific text (variable), in a specific place inside the document

any hint how to do it?

thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 6th, 2011, 5:48 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Have you read the docs for WatchDirectory?
What do you need help with reqards to it?
The questions you have are not related to WatchDirectory?
WatchDirectory will just launch your function whenever a change happened, you can then do what ever you like depending on the 2 parameters in your function.

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 6th, 2011, 6:35 pm 
Offline

Joined: June 7th, 2007, 1:33 pm
Posts: 1019
HotKeyIt wrote:
Have you read the docs for WatchDirectory?
What do you need help with reqards to it?
The questions you have are not related to WatchDirectory?
WatchDirectory will just launch your function whenever a change happened, you can then do what ever you like depending on the 2 parameters in your function.


where are the docs? I only read what is mentioned in the first post of this topic

as I understand it, it should work like this:

Code:
#Persistent
WatchDirectory("C:\Windows",1) ; this will monitor the folder and the 1 means to monitor subfolders too (I suppose)
Report(Action,Folder,File) ; this will perform the action to the specified files??? how do I specify the action and how do I specify that the files must be the newly created ones?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 6th, 2011, 7:06 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
You will need to use loop or SetTimer.
Code:
#Persistent
WatchDirectory("C:\Windows",1)
Loop
   Report(Action,Folder,File)

Sorry I thought you were using AHK_L version and have mixed up the threads.
Are you using AutoHotkey basic? This version of WatchDirectory() does not support unicode and was thought for AutoHotkey basic only.

I would suggest to use AutoHotkey_L or AutoHotkey_H and thisversion.

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: WatchDirectory()
PostPosted: May 11th, 2012, 4:38 am 
I don't understand how to implement this code in my code to trigger a Label. Can someone help me execute a Label with simple MsgBox when something changes in "C:\Watch"?


Report this post
Top
  
Reply with quote  
 Post subject: Re: WatchDirectory()
PostPosted: May 11th, 2012, 5:12 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
NexutixTemp wrote:
I don't understand how to implement this code in my code to trigger a Label. Can someone help me execute a Label with simple MsgBox when something changes in "C:\Watch"?

You will need to trigger a function and then your label frm there, e.g.
Code:
ReportToFunction(from,to){
   global FileChangedFrom, FileChangedTo
   FileChangedFrom:=from,   FileChangedTo:=to
   GoSub, MyLabel
}
MyLabel:
   MsgBox % "File Changed from:`n" FileChangedFrom "`nTo`n" FileChangedTo
Return

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 57 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 19 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group