--------------------
Code: Select all
re //words start with re...
return
rest
remove
str //AHK script: about string...
StrReplace(A_Clipboard, "``r``n")
if InStr(txt0, "searching string")
...ect
Code: Select all
#Requires AutoHotkey v2.0
#SingleInstance force
;re := ""
txt0 := "re //words start with re..." ;use loop and strSplit got this line
test()
;#Include "hotKey.ahk2"
:?X:re::showMenu("re") ;fileAppend to other *.ahk and attach here
;:?X:str::showMenu("str")
test(*) {
global
hs0 := StrSplit(txt0, "`t")
/*-------------
;global %hs0[1]% := hs0[2] ;error
;%hs0[1]% := hs0[2]
;MsgBox re
--------*/
;why %hs0[1]% can't default the value and
;how to assign %hs0[1]% as a global variable to be use outoutside the {}
%hs0[1]% := menu()
%hs0[1]%.Add("return", pasteMenu)
%hs0[1]%.Add()
%hs0[1]%.Add("rest", pasteMenu)
%hs0[1]%.Add("remove", pasteMenu)
}
showMenu(M0) {
CaretGetPos(&x0, &y0)
if (x0 = "" or y0 = "") {
MouseGetPos &x0, &y0
} else {
x0 := x0 - 15
y0 += 50
}
sleep 500
%M0%.Show(x0, y0)
}
pasteMenu(x0, *) {
A_Clipboard := x0
sleep 20
Send "^v"
}
ps. if i add
re := ""
at the very begining, the script works.
[Mod edit: Added code box for text file so users can actually see where the tab characters are.]