AutoHotkey: Unpack each archive to a separate subdir: Difference between revisions

From TotalcmdWiki
Jump to navigation Jump to search
mNo edit summary
Line 7: Line 7:
   
   
  ~!F6::
  ~!F6::
  Sleep, 250
  If WinActive("ahk_class TTOTAL_CMD") or WinActive("ahk_class TDLGUNZIPALL")
IfWinActive, ahk_class TDLGUNZIPALL
  {
  {
  WinWaitActive, ahk_class TDLGUNZIPALL
   ControlSend, TCheckBox1, {SPACE}
   ControlSend, TCheckBox1, {SPACE}
   ControlFocus, TEdit2
   ControlFocus, TEdit2
Line 17: Line 17:
   
   
  ~!F9::
  ~!F9::
  Sleep, 250
  If WinActive("ahk_class TTOTAL_CMD") or WinActive("ahk_class TDLGUNZIPALL")
IfWinActive, ahk_class TDLGUNZIPALL
  {
  {
  WinWaitActive, ahk_class TDLGUNZIPALL
   ControlSend, TCheckBox1, {SPACE}
   ControlSend, TCheckBox1, {SPACE}
   ControlFocus, TEdit2
   ControlFocus, TEdit2
Line 25: Line 25:
  }
  }
  Return
  Return


= Script solution 2 =
= Script solution 2 =

Revision as of 06:27, 1 September 2005

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. 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...

; If you always want to extract to the active panel remove the semicolons
; in front of the lines ;Send {DEL}.

~!F6::
If WinActive("ahk_class TTOTAL_CMD") or WinActive("ahk_class TDLGUNZIPALL")
{
  WinWaitActive, ahk_class TDLGUNZIPALL
  ControlSend, TCheckBox1, {SPACE}
  ControlFocus, TEdit2
  ;Send {DEL}
}
Return

~!F9::
If WinActive("ahk_class TTOTAL_CMD") or WinActive("ahk_class TDLGUNZIPALL")
{
  WinWaitActive, ahk_class TDLGUNZIPALL
  ControlSend, TCheckBox1, {SPACE}
  ControlFocus, TEdit2
  ;Send {DEL}
}
Return

Script solution 2

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.

; If you always want to extract to the active panel remove the semicolons
; in front of the lines ;Send {DEL}.

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


Script solution 3

Upon pressing Ctrl+Alt+Shift+F9 this script automatically unpacks the selected archives to subdirectories of the current dir.

$^!+F9::
IfWinActive ahk_class TTOTAL_CMD
{
	PostMessage, 1075, 509
	WinWaitActive, ahk_class TDLGUNZIPALL
	Send, {Del}
	Control, Check, , TCheckBox1
	Send, {Enter}
}
else
	Send ^!+{F9}
return


Back to AutoHotkey