AutoHotkey Community

It is currently May 26th, 2012, 9:10 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: July 3rd, 2009, 11:45 am 
Offline

Joined: July 2nd, 2009, 6:54 am
Posts: 9
I want to run a program whenever a certain text file is modified. Is this possible? This is what I've mustered up but it does nothing.

Code:
FileGetTime, todo_time, D:\todo.txt

if (todo_time = A_Now)
{
   Run C:\Program Files\SysInternals-Nirsoft\Bginfo.exe "D:\update_todo.bgi" /timer:0
   Return
}


Can someone give me a hand? :)


Last edited by supulton on July 3rd, 2009, 10:33 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2009, 12:36 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
My hand:

Code:
Loop
  If InStr( FileExist( "D:\todo.txt" ), "A" )  {
  RunWait C:\Program Files\SysInternals-Nirsoft\Bginfo.exe "D:\update_todo.bgi" /timer:0
  FileSetAttrib, -A, D:\todo.txt
  }
  Else  Sleep 250


Last edited by SKAN on July 3rd, 2009, 12:46 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2009, 12:42 pm 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
Code:
Second hand
Loop {
  If InStr( FileExist( "D:\todo.txt" ), "A" ) {
    RunWait C:\Program Files\SysInternals-Nirsoft\Bginfo.exe "D:\update_todo.bgi" /timer:0
    FileSetAttrib, -A, D:\todo.txt
  }
  Sleep 250 ; sleep for each iteration
}

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2009, 12:47 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Thanks a tonne. :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2009, 10:01 pm 
Offline

Joined: July 2nd, 2009, 6:54 am
Posts: 9
It works great guys! Thanks muchly :)


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Exabot [Bot], krajan, patgenn123 and 58 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