Brickoneer Posted October 9, 2007 Posted October 9, 2007 (edited) I recently created this little piece of code that helped me stay on task. Very simple, but effective.;#NoTrayIcon HotKeySet("{pause}", "Pause") HotKeySet("^+!z", "Terminate") ; Exit on a Ctrl + Shift + Alt + Z... you can't "accidentally" hit it. $Paused=0 Opt("WinTitleMatchMode", -2) ; Set the Title match mode to 'substring' non-case sensative. while 1 $FF = WinGetTitle("Mozilla Firefox") ; See if a FF browser exists... $IE = WinGetTitle("Microsoft Internet Explorer") ; See if a IE browser exists... Select ; If there is a browser, kill it! case $FF <> "" WinClose($FF) Case $IE <> "" WinClose($IE) EndSelect sleep(100) WEnd Func Pause() $Paused = NOT $Paused While $Paused sleep(1000) WEnd EndFunc Func Terminate() MsgBox(0,"","Terminated.") Exit EndFuncAs I said, very simple. (of course it is... I made it!)Just thought I'd share with those who also struggle with staying on task. Brick Edited October 9, 2007 by Brickoneer
Skizmata Posted October 9, 2007 Posted October 9, 2007 Would have replied sooner but had to test the script *doh*. Nice work. AutoIt changed my life.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now