AutoHotkey: Move Quicksearch Box To Make Status Bar Visible: Difference between revisions

From TotalcmdWiki
Jump to navigation Jump to search
m (bugfix: one ahk_class too much)
(Added category AutoHotkey scripts)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Press '''''Shift+Q''''' to show quicksearch box and then use it as usual. After each keypress it will be closed, recalled with the former content and then docked at the lower left end of the TC window. The effect is that the status bar will be always visible while quicksearching and it will always reflect the found file-/foldername.
Press '''''Shift+Q''''' to show quicksearch box and then use it as usual. After each keypress it will be closed, recalled with the former content and then docked at the lower end of the TC window. The effect is that the status bar will be always visible while quicksearching and it will always reflect the found file-/foldername.


'''Attention:''' Always close the quicksearch box by pressing '''''ESC''''', otherwise it will continue running in the background!
'''Attention:''' Always close the quicksearch box by pressing '''''ESC''''', otherwise it will continue running in the background!


  $+Q::  
  $+Q::                                                   ;define hotkey Shift+Q
  String=  
  String=                                                 ;initialize String variable
  IfWinActive, ahk_class TTOTAL_CMD  
  IfWinActive, ahk_class TTOTAL_CMD                       ;if TC is active start quicksearching,
  {  
                                                        ;otherwise send Shift+Q
   Loop  
  {
   {  
   Loop                                                 ;start loop
     WinGetPos, X, Y, Width, Height, ahk_class TTOTAL_CMD
   {
     PostMessage, 1075, 2915, , , ahk_class TTOTAL_CMD
     WinGetPos, , Y, , Height, A                        ;get TC-window Y-dimensions
     WinWait, ahk_class TQUICKSEARCH  
     PostMessage, 1075, 2915, , , A                      ;call quicksearch box
     WinMove, A, , X+4, Y+Height  
     WinWait, ahk_class TQUICKSEARCH                     ;wait for quicksearch box to appear
     ControlSetText, TTabEdit1, %String%  
     WinMove, A, , , Y+Height                           ;move quicksearch box down
     ControlSend, TTabEdit1, {END}  
     ControlSetText, TTabEdit1, %String%                 ;reload content of quicksearch box
     Input, Keypress, L1 I M V, {ESC}  
     ControlSend, TTabEdit1, {END}                       ;move cursor to the end of quicksearch box
     If Errorlevel=EndKey:Escape  
     Input, Keypress, L1 I M V, {ESC}{LButton}{RButton}  ;wait for input
     {  
     If Errorlevel=EndKey:Escape                         ;when ESC has been pressed exit loop
       ControlSend, TTabEdit1, {ESC}  
     {
       Break  
       ControlSend, TTabEdit1, {ESC}
     }  
       Break
     ControlGetText, String, TTabEdit1  
     }
     Send, {ESC}  
     ControlGetText, String, TTabEdit1                   ;get content of quicksearch box
   }  
     Send, {ESC}                                         ;close quicksearch box
  }  
   }
  Else Send, {SHIFT}Q  
  }
  Else Send, {SHIFT}Q
  Return
  Return
{{translated|AutoHotkey: Verschiebe das 'Schnellsuche-Fenster' (Quicksearch) um die Stausbar sichtbar zu machen|AutoHotkey}}
[[Category:AutoHotkey scripts|Move Quicksearch Box To Make Status Bar Visible]]

Latest revision as of 23:53, 31 May 2008

Press Shift+Q to show quicksearch box and then use it as usual. After each keypress it will be closed, recalled with the former content and then docked at the lower end of the TC window. The effect is that the status bar will be always visible while quicksearching and it will always reflect the found file-/foldername.

Attention: Always close the quicksearch box by pressing ESC, otherwise it will continue running in the background!

$+Q::                                                   ;define hotkey Shift+Q
String=                                                 ;initialize String variable
IfWinActive, ahk_class TTOTAL_CMD                       ;if TC is active start quicksearching,
                                                        ;otherwise send Shift+Q
{
  Loop                                                  ;start loop
  {
    WinGetPos, , Y, , Height, A                         ;get TC-window Y-dimensions
    PostMessage, 1075, 2915, , , A                      ;call quicksearch box
    WinWait, ahk_class TQUICKSEARCH                     ;wait for quicksearch box to appear
    WinMove, A, , , Y+Height                            ;move quicksearch box down
    ControlSetText, TTabEdit1, %String%                 ;reload content of quicksearch box
    ControlSend, TTabEdit1, {END}                       ;move cursor to the end of quicksearch box
    Input, Keypress, L1 I M V, {ESC}{LButton}{RButton}  ;wait for input
    If Errorlevel=EndKey:Escape                         ;when ESC has been pressed exit loop
    {
      ControlSend, TTabEdit1, {ESC}
      Break
    }
    ControlGetText, String, TTabEdit1                   ;get content of quicksearch box
    Send, {ESC}                                         ;close quicksearch box
  }
}
Else Send, {SHIFT}Q
Return

Back to AutoHotkey