This repository has been archived by the owner on Jan 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXYAHKLiveFilter.xys
54 lines (50 loc) · 2.89 KB
/
XYAHKLiveFilter.xys
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//XYAHKLiveFilter.xys/v5.0.1b//author:SammaySarkar
//http://xyplorer.com/xyfc/viewtopic.php?&t=12588
//https://github.com/smsrkr/XYAHKLiveFilter
//following variables are customizable options, each of these can be set empty
//$OPTION="DEFAULT": DESCRIPTION
//------------------------------
//$FocusHotkey='^`': Keyboard shortcut to focusbox filter. ^=CTRL,!=ALT,+=SHIFT,!Space = ALT+SPACE
//TAB/SHIFT+Tab, ENTER and ALT+P are reserved, please do not use any of these.
$FocusHotkey = '^`' ;
//------------------------------
//$SyncToAB=1: Keep filterbox position in sync with addressbar (forces addressbar to stay visible)
//On any other value, the filterbox stay at the topright corner (doesn't change addressbar status)
$SyncToAB = 1 ;
//-------------------------------
//$ABPadding=5: Y-axis positon adjustment (in pixels) of filterbox. Use a small number: 0,4,-3 etc
//Change this only if filterbox top margin doesn't match addressbar's. No effect if $SyncToAB != 1
$ABPadding = 5 ;
//-------------------------------
//$Quote='S': Controls how the VF pattern is quoted. Use "S" for single quotes or "D" for doubles.
//Any quotes inside the pattern are taken care of. XY variables are not resolved in single quotes.
$Quote = 'S' ;
//-------------------------------
//NextAction=1: Controls what subsequent tries to start XYAHKLiveFilter do. 1: refocus, 2: close.
//So you can, for example, call the script once to open the filterbox, and run again to focus it.
//NextActionCTB=2: same as $NextAction, but overrides it when run via CTB.
//So clicking the CTB will close it, matching XYplorer toggle button behavior, but running the xys
//or calling it from UDC or Catalog etc will focus it instead.
$NextAction = 1 ;
$NextActionCTB = 2 ;
//-------------------------------
//path to XYAHKLiveFilter.exe. change this only if you have "installed" to a non-default location.
$XYAHKLiveFilterExe = "<xyscripts>\XYAHKLiveFilter.exe";
//$XYAHKLiveFilterExe = "<@programs>\autohotkey\autohotkey.exe"" ""XYAHKLiveFilter.ahk";
//------------------------------//
// DO NOT MODIFY ANYTHING BELOW //
//------------------------------//
$OwnCTB = <get trigger ctbindex>;
perm $p_XYAHKLiveFilter_A, $p_XYAHKLiveFilter_B;
if ($p_XYAHKLiveFilter_A != 1)||(gettoken($p_XYAHKLiveFilter_B,1) != <hwnd>){
$p_XYAHKLiveFilter_A = 1; $p_XYAHKLiveFilter_B = <hwnd>;
if ($OwnCTB > 0) {ctbstate(1, $OwnCTB);}
run trim(<<<#RuncmD
"$XYAHKLiveFilterExe" <hwnd> "$FocusHotkey" "$ABPadding" "$SyncToAB" "$OwnCTB" "$Quote"#RuncmD,
" <tab>", L),, 0;
} else {
$action = 'FOCUS QUIT';
if ($OwnCTB > 0) { $NextAction = $NextActionCTB; }
$action = gettoken($action, ((strpos('012', $NextAction) < 1) ? 1 : $NextAction));
if ($action) { copydata gettoken($p_XYAHKLiveFilter_B, 2), $action, 1; }
}