AutoHotkey Community

It is currently May 27th, 2012, 4:24 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: February 24th, 2010, 1:54 pm 
Offline

Joined: November 18th, 2009, 2:07 pm
Posts: 11
How do I approach this problem?
I want to watch a desktop folder and send any addition straight to the printer. Thanks for any ideas.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2010, 2:09 pm 
What about the privacy of the desktops owner? Sounds like sniffing :?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2010, 2:26 pm 
Offline

Joined: February 1st, 2010, 2:50 pm
Posts: 237
Location: Netherlands
Something simple like this?

Code:
; Directory to watch
WatchDir = C:\Temp

; build initial file list
PrevFileList = `n ; Initialize
Loop, %WatchDir%\*.*
    PrevFileList = %PrevFileList%%A_LoopFileName%`n
; msgbox,%PrevFileList% ; uncomment to see existing files

Loop
{
   ; Check new files
   NewFileList = `n ; Initialize
   Loop, %WatchDir%\*.*
   {
      NewFileList = %NewFileList%%A_LoopFileName%`n
      IfNotInString, PrevFileList, %A_LoopFileName%
         msgbox,%WatchDir%\%A_LoopFileName% ; or something like: Run, print %WatchDir%\%A_LoopFileName%
   }
   PrevFileList = %NewFileList%
   Sleep, 5000 ; time (ms)between check for new file
}



Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2010, 3:08 pm 
Offline

Joined: November 18th, 2009, 2:07 pm
Posts: 11
In regards to sniffing...this is simply an automation, no sniffing involved.
I added the following changes, seems to be no-worky.

WatchDir = C:\C:\Documents and Settings\KIP\Desktop\test


PrevFileList = `n
Loop, %WatchDir%\*.*
PrevFileList = %PrevFileList%%A_LoopFileName%`n


Loop
{
NewFileList = `n
Loop, %WatchDir%\*.*
{
NewFileList = %NewFileList%%A_LoopFileName%`n
IfNotInString, PrevFileList, %A_LoopFileName%
Run, print %WatchDir%\%A_LoopFileName%
}
PrevFileList = %NewFileList%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2010, 5:20 pm 
Offline

Joined: November 28th, 2009, 4:45 am
Posts: 3089
You might want to put that sleep back in or it will eat resources :)
Code:
WatchDir = C:\C:\Documents and Settings\KIP\Desktop\test
Slight Problem here

Code:
}
PrevFileList = %NewFileList%
} ;Put me back


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2010, 6:25 pm 
Offline

Joined: November 18th, 2009, 2:07 pm
Posts: 11
good eye, you stinker!!!
UR THE MAN
THANKS TO ALL WHO REPLIED TO HELP ME.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2010, 9:12 pm 
Offline

Joined: February 1st, 2010, 2:50 pm
Posts: 237
Location: Netherlands
Forgot to add `n rond the filename so a name partial matching would not be missed (there was a reason i started with a `n).
Code:
      IfNotInString, PrevFileList, `n%A_LoopFileName%`n


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Mickers, rbrtryn, Yahoo [Bot] and 66 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