Jump to content

Get your work done!


Brickoneer
 Share

Recommended Posts

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
EndFunc

As 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 by Brickoneer
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...