AutoHotkey: Auto-Delete BAK-files created by TC's File-Compare-Editor
Jump to navigation
Jump to search
; //////////////////////////////////////////////////////////////////////////// ; // TC_CompareEditor_AutoDelBak.ahk v0.1 ; // (W) StatusQuo 2008 for TC 7.03 ; //-------------------------------------------------------------------------- ; // Auto-deletes *.bak-files created by TC's File-Compare-Editor ; // (after confirmation) ; // Only works with a single instance of TC's compare window for now. ; //////////////////////////////////////////////////////////////////////////// #SingleInstance, Force Loop { WinWaitActive, ahk_class TFileCompForm ControlGetText, sFNLeft , TEdit2 ControlGetText, sFNRight, TEdit1 sBakLeft := sFNLeft . ".bak" sBakRight := sFNRight . ".bak" Loop ; wait for compare-editor to close { Sleep, 500 ; save CPU time IfWinNotExist, ahk_class TFileCompForm Break } if not ( f_DelBak( sBakLeft ) = "10") f_DelBak( sBakRight ) Sleep, 200 PostMessage, 1075, 540,,, ahk_class TTOTAL_CMD ; cm_RereadSource } Return f_DelBak( sFNBak ) { IfNotExist, %sFNBak% Return MsgBox, 35,, Delete Backup file?`n`n%sFNBak% IfMsgBox, Cancel Return, 10 IfMsgBox, Yes FileRecycle, %sFNBak% }
Back to AutoHotkey