-
-
Save crazy4groovy/6454599 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Stupid simple autoit script for cleaning up "orphaned" notepad instances | |
; I end up with dozens of notepad instances after a day of coding and it's a pain to close all these manually | |
; as I do want to keep some of them. | |
; Public Domain | |
; Philip Bjorge | |
; June 2, 2012 | |
Local $windows=WinList() | |
For $i = 1 To $windows[0][0] | |
If StringInStr($windows[$i][0], "Notepad", 0) Then | |
WinSetState($windows[$i][1], "", @SW_MAXIMIZE) | |
If MsgBox(4, "Notepad Cleaner", "Do you want to kill this notepad instance?", 0, $windows[$i][1]) = 6 Then | |
WinClose($windows[$i][1]) | |
WinWaitActive("Notepad", "Save") | |
;WinWaitActive("Notepad", "Do you want to save") ; When running under Windows XP | |
Send("!n") | |
EndIf | |
EndIf | |
Next |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment