AutoHotkey: Unpack each archive to a separate subdir

From TotalcmdWiki
Revision as of 11:30, 27 June 2005 by Icfu (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
; Script solution 1

; Whenever the unpack dialog is invoked by Alt+F6 or Alt+F9, the checkbox
; Unpack each archive to a separate subdir is automatically toggled and
; the focus is reset to the path box.
; If you always want to extract to the active panel remove the semicolons
; in front of the lines ;  Send {DEL}.
; In contrary to the second solution this script uses no resources when idling but it
; works only with the hotkeys, not by calling the dialog by button, menu entry, etc...

~!F6::
Sleep, 250
IfWinActive, ahk_class TDLGUNZIPALL
{
  ControlSend, TCheckBox1, {SPACE}
  ControlFocus, TEdit2
  ;Send {DEL}
}
Return

~!F9::
Sleep, 250
IfWinActive, ahk_class TDLGUNZIPALL
{
  ControlSend, TCheckBox1, {SPACE}
  ControlFocus, TEdit2
  ;Send {DEL}
}
Return
; Script solution 2

; Whenever the unpack dialog is invoked, the checkbox
; Unpack each archive to a separate subdir is automatically set and the
; focus is reset to the path box.
; If you always want to extract to the active panel remove the semicolons
; in front of the lines ;  Send {DEL}.
; In contrary to the first solution this script uses a little CPU performance
; due to the permanent monitoring but its advantage is that it doesn't matter
; how the unpack dialog is invoked.

Loop
{
  WinWaitActive, ahk_class TDLGUNZIPALL
  ControlSend, TCheckBox1, {SPACE}
  ControlFocus, TEdit2
  ;Send {DEL}
  WinWaitNotActive, ahk_class TDLGUNZIPALL
}
Return


Back to AutoHotkey