-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathquickz.ahk
141 lines (121 loc) · 3.19 KB
/
quickz.ahk
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#NoEnv
#SingleInstance, Force
SetBatchLines, -1
SendMode Input
SetWorkingDir %A_ScriptDir%
SetKeyDelay, -1
SetControlDelay,-1
DetectHiddenWindows On
CoordMode, Mouse, Screen
quickz.Init()
quickz.OnWMCopyData()
quickz.LoadPlugins()
quickz.InitPlugins()
menuz.config({cliptimeout: 400
,onGetWin: ""
,onGetClip: "myGetClip"})
menuz.SetFilter("tt", "texttype")
menuz.SetCommand("sendtext", "sendtext")
menuz.SetCommand("sendenter", "sendenter")
menuz.SetCommand("copynamenoext", "copynamenoext")
menuz.settag("test", "tagtest")
menuz.settag("box", "tagbox")
menuz.setdynamic("firstmenu", objBindMethod(menuz, "firstmenu"))
; gesturez.add(9, ObjBindMethod(menuz, "Active"))
; gesturez.add("c", "calc", "Notepad")
; gesturez.add("n", "notepad")
; gesturez.add("u", "down")
return
tagtest(env, tag) {
msgbox % tag ; {test: some}
msgbox % env.file.name
}
tagbox(env, tag) {
if (InStr(tag, "folder")) {
FileSelectFolder, folderPath, , , 选择文件夹
return folderPath
}
if (InStr(tag, "file")) {
FileSelectFile, filePath, , , 选择文件
if (not StrLen(filePath)) {
env.break()
}
return filePath
}
}
sendtext(env, item) {
WinActivate, % "ahk_id " env.winHwnd
SendRaw % menuz.ReplaceTag(item.param)
env.break()
}
sendenter(env, item) {
WinActivate, % "ahk_id " env.winHwnd
Send {enter}
}
copynamenoext(env, item) {
clipboard := env.file.namenoext
}
myGetClip(env, event) {
if (event == "GetClip") {
if (env.winExe == "gvim.exe") {
clipBackup := ClipboardAll
Clipboard := ""
SendRaw "+y
ClipWait, % env.config.ClipTimeOut, 1
env.isWin := ErrorLevel
clipData := Clipboard
env.isText := true
env.text := clipData
env.isGetClip := true
}
}
}
filtertest(env, filter) {
msgbox filter> %filter%
return true
}
exectest(env, item) {
msgbox exec
}
TextType(env, filter) {
textTypeName := ""
textRegexList := {url: "(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]"}
for textType, TypeRegex in textRegexList
{
if (RegExMatch(env.text, TypeRegex)) {
textTypeName := textType
break
}
}
return env.TestRule(filter, textTypeName)
}
return
; gui, add, edit, w200 h20 , %tomatch%
; gui, add, edit, w200 h20 ,%equation%
; gui, add, button, default gRegex,正则式
; gui, show
; regex:
; GuiControlGet, match, , edit1
; GuiControlGet, string, , edit2
; result := RegExMatch(string, match, m)
; msgbox % result "`n" m
return
!x::reload
!q::menuz.Active()
RButton::
gesturez.Recognize()
return
#include lib\class_vimd.ahk
#include lib\class_menuz.ahk
#include lib\class_gesturez.ahk
#include lib\class_tesseract.ahk
#include lib\class_quickz.ahk
#include lib\class_json.ahk
#include lib\class_easyini.ahk
#include lib\pum.ahk
#include lib\pum_api.ahk
#include lib\struct.ahk
#include lib\sizeof.ahk
#include lib\yaml.ahk
#include lib\Path_API.ahk
#include *i user\include.ahk