Sunday, January 9, 2011

Automatic Save Your Document at Specified Period of Time

 In this post we will see  Automatic saving Documents , avoiding overhead of pressing Ctrl + s periodically.


It requires Autohotkey should to be installed, if yet not installed then click here.




·        Open Autohotey script form right side of taskbar, right click on Autohotkey icon(showing “ H ”) select  “ Edit this Script ”.



·        Copy below script and paste in to Autohotey script.


!S::                  ; indicates hotkey(Alt + S)                                                        
loop               ;continuously executes following code                               
{
            sleep 3000           ; send save at every 3 sec.
            send ^s                  ; send save command
            GetKeyState, state, F2 ; check if F2 is pressed                                 
if state = D  ;if key pressed then state=D else  U
             break                           ;Breaks the loop
}
return                     ;returns from hotkey excecution


·        Here D means Down(key pressed), U means Up(key not pressed)

·        Now save this file and “reload this script” by method as we selected “Edit this Script”.

·        And then open any document file or new one and press Alt+s your script will starts to run.

·        Press F2 to stop this script. Be careful while pressing F2 as script will not detect F2 when it sleeps. So you may need to press F2 more times to detect it in script running time. Or else You can just Exit from Autohotkey , after completing your task.

You can also starts to make such scripts from your ideas to “Simplify Windows”.

To get full document regarding Autohotkey script click here.

No comments:

Post a Comment