Search found 114 matches

by dsewq1LYJ
21 Dec 2018, 04:22
Forum: Ask For Help
Topic: Dynamic global variable for GUI,Add
Replies: 0
Views: 162

Dynamic global variable for GUI,Add

My first attempt global vars := [] , vars_i := 0 add("foo") add(var) { vars.Push(var) vars_i++ alias := vars[vars_i] Gui,mc:Add,Text,V%alias% } it cause error : Error: A control's variable must be global or static. so I google "ahk dynamic global variable" on google. It turns out I can use "global l...
by dsewq1LYJ
20 Aug 2018, 21:52
Forum: Ask For Help
Topic: The input issue between dictionary Topic is solved
Replies: 2
Views: 300

Re: The input issue between dictionary Topic is solved

gregster wrote:Tricky, but this works:

Code: Select all

dict := {"1": "foo"}
Input,uin,L1
msgbox % dict["" uin ""] 
ExitApp
Two " in an expression ("") create a literal " . With the integer in between you can create a string... and this gets you dict["1"]
Damn man.

Well done. Cool sheep
:dance:
by dsewq1LYJ
20 Aug 2018, 21:07
Forum: Ask For Help
Topic: The input issue between dictionary Topic is solved
Replies: 2
Views: 300

The input issue between dictionary Topic is solved

Hi Guys Today I met a problem. If you try to using "Input" command to retrieve the user input. The command always treat "0 to 9"(digits) as "Integer". You can check it with Input,foo,L1 if foo is integer ToolTip ...it's an integer and if you try to use the output(digits) for a dictionary, that's def...
by dsewq1LYJ
02 Jan 2018, 07:58
Forum: Ask For Help
Topic: Problem with suspend mapped combinations
Replies: 2
Views: 346

Re: Problem with suspend mapped combinations

Hallo, try: #IfWinActive ahk_class SUSPEND_THEM ~Esc & ~w::return ~Esc & ~a::return ~Esc & ~s::return ~Esc & ~d::return but better: #IfWinNotActive ahk_class SUSPEND_THEM Esc & w::do_something() Esc & a::do_something() Esc & s::do_something() Esc & d::do_something() !w::do_something() !a::do_someth...
by dsewq1LYJ
01 Jan 2018, 09:46
Forum: Ask For Help
Topic: Clipboard not work properly with ^v Topic is solved
Replies: 2
Views: 295

Re: Clipboard not work properly with ^v Topic is solved

https://i.imgur.com/FjDn18t.png Do not find any problem , some other ( ahk ?) program must be interfering with your clipboard. Loop,1000 foo .="o" run , notepad.exe WinWaitActive, ahk_exe notepad.exe loop 20 { clipboard:="" QPC(1) Clipboard :=foo QPC(0) "`n" clipwait Send ^v } exitapp QPC(R := 0) {...
by dsewq1LYJ
01 Jan 2018, 03:04
Forum: Ask For Help
Topic: Clipboard not work properly with ^v Topic is solved
Replies: 2
Views: 295

Clipboard not work properly with ^v Topic is solved

TEST SCRIPT: global foo := "" Loop,1 foo.="o" return +F12:: QPC(1) Send %foo% TEST1 := QPC(0) QPC(1) tmp := Clipboard , Clipboard := foo SendPlay ^v TEST2 := QPC(0) Tooltip % TEST1 "`n" TEST2 return QPC(R := 0) { static P := 0, F := 0, Q := DllCall("QueryPerformanceFrequency", "Int64*", F) return !D...
by dsewq1LYJ
08 Dec 2017, 20:20
Forum: Ask For Help
Topic: Switch two applications by Send AltTab
Replies: 0
Views: 197

Switch two applications by Send AltTab

Send !{Tab} Send {Alt Down} Sleep 32 Send {Tab} Sleep 32 Send {Alt Up} SetKeyDelay,32,32 Send {Alt Down} Sleep 32 Send {Tab} Sleep 32 Send {Alt Up} Send {Alt Down} Sleep 32 Send !{Tab} Sleep 32 Send {Alt Up} All of them is pushing the current one to the last and activate next one. How do I simulate...
by dsewq1LYJ
25 Oct 2017, 09:55
Forum: Ask For Help
Topic: Problem with suspend mapped combinations
Replies: 2
Views: 346

Problem with suspend mapped combinations

Think about follow code Esc & w::do_something() Esc & a::do_something() Esc & s::do_something() Esc & d::do_something() !w::do_something() !a::do_something() !s::do_something() !d::do_something() #IfWinActive ahk_class SUSPEND_THEM ~Esc & w::return // This line cause Esc & w send nothing, it should ...
by dsewq1LYJ
16 Oct 2017, 06:27
Forum: Ask For Help
Topic: Confused about Regular Expression Topic is solved
Replies: 2
Views: 351

Re: Confused about Regular Expression Topic is solved

just me wrote:You might need the s option for AHK:

Code: Select all

while (re_pos := RegExMatch(Text, "Os)\t*for k,v in [^}]*}", re_occur, (re_pos ? re_pos + 1 : 1)))
{
   MsgBox % ": " re_occur[0]
}
Thank you so much !
It worked ! :dance:
by dsewq1LYJ
14 Oct 2017, 04:03
Forum: Ask For Help
Topic: Confused about Regular Expression Topic is solved
Replies: 2
Views: 351

Confused about Regular Expression Topic is solved

I try to match whole dictionary block by using RegExMatch() This pattern works like a charm in regex101 https://i.imgur.com/w0uvDo7.png but not work with AutoHotkey, here is the code. while (re_pos := RegExMatch(Text, "O)(\t){0,}for k,v in ([^}]|\s)*+}", re_occur, (re_pos ? re_pos + 1 : 1))) { MsgBo...
by dsewq1LYJ
07 Sep 2017, 08:50
Forum: Ask For Help
Topic: Error if ARRAY[i] in LIST OR if DICT[k][i] in LIST
Replies: 2
Views: 348

Re: Error if ARRAY[i] in LIST OR if DICT[k][i] in LIST

Var - The name of the variable whose contents will be checked. source array is not a variable name, it is an expression. Hence if array in list an expression style if , where the content of array is concatenate d with the blank variable in and the variable list . If you set array !=0 and list!=0 th...
by dsewq1LYJ
07 Sep 2017, 01:04
Forum: Ask For Help
Topic: Error if ARRAY[i] in LIST OR if DICT[k][i] in LIST
Replies: 2
Views: 348

Error if ARRAY[i] in LIST OR if DICT[k][i] in LIST

Issue: if Lorem_dict[__ITR__][1] in %str_exe_Lorem_% Error: Error: The following variable name contains an illegal character. Indirectly fix: P := Lorem_dict[__ITR__][1] if P in %str_exe_Lorem_% COPY AND PASTE ME TO REVIEW PROBLEM ; https://autohotkey.com/docs/commands/IfIn.htm AN_INT := 15 AN_ARRAY...
by dsewq1LYJ
08 Jun 2017, 01:13
Forum: Ask For Help
Topic: "AND,OR" for "if var in seq" Topic is solved
Replies: 9
Views: 1570

Re: "AND,OR" for "if var in seq" Topic is solved

It's not clear what you are trying to do. What is the contents of var, foo and bar? The "if var in" syntax is for checking if something is in a match list, and you do not appear to have provided a list f var in 1,2,3,5,7,11 According to the docs, if var in %MyItemList% is valid syntax, but I cannot...
by dsewq1LYJ
08 Jun 2017, 01:10
Forum: Ask For Help
Topic: "AND,OR" for "if var in seq" Topic is solved
Replies: 9
Views: 1570

Re: "AND,OR" for "if var in seq" Topic is solved

"If var in" doesn't support or/and. You can, however, append the two to act as an or. Otherwise, you will need a separate statement. foo:="1,2,3" bar:="Hwnd,Qt5,Window" ;ex1 WinGetClass,C,A if C in %foo% doFoo() else if C contains %bar% doFoo() You can also create functions for these statements, al...
by dsewq1LYJ
07 Jun 2017, 05:31
Forum: Ask For Help
Topic: "AND,OR" for "if var in seq" Topic is solved
Replies: 9
Views: 1570

Re: "AND,OR" for "if var in seq" Topic is solved

It's not clear what you are trying to do. What is the contents of var, foo and bar? The "if var in" syntax is for checking if something is in a match list, and you do not appear to have provided a list f var in 1,2,3,5,7,11 According to the docs, if var in %MyItemList% is valid syntax, but I cannot...
by dsewq1LYJ
07 Jun 2017, 04:45
Forum: Ask For Help
Topic: "AND,OR" for "if var in seq" Topic is solved
Replies: 9
Views: 1570

"AND,OR" for "if var in seq" Topic is solved

The "if var in / contains seq" is not support AND/OR.
or I'm doing sth wrong ?

Code: Select all

if var in %foo%
|| var in %bar%
{
	MsgBox Won't hit me "if foo not correct"
}
by dsewq1LYJ
16 May 2017, 06:45
Forum: Wish List
Topic: Improve InStr or IfInString
Replies: 22
Views: 3585

Improve InStr or IfInString

WinGetTitle,T,ahk_id %wID% if InStr(T,"Add") || InStr(T,"Install") || InStr(T,"Launch") || InStr(T,"License") || InStr(T,"Setup") || InStr(T,"Vim") {} It looks not nice (I'm not talking about readabilitiy, i'm talking about performance), but this one is much faster than RegExMatch(). WinGetTitle,T,...
by dsewq1LYJ
27 Apr 2017, 08:45
Forum: Ask For Help
Topic: Is it a bug?
Replies: 2
Views: 364

Re: Is it a bug?

IfInstring cannot take "||" or "`|`|" as a parameter. But InStr() can use it. Test code: MyString=AAA,BBB,||,|CCC||,DDD Loop Parse, MyString, `, IfInString,%A_LoopField%,|| ;if InStr(A_LoopField,"||") Msgbox Found! Thanks! MyString=AAA,BBB,||,|CCC||,DDD Loop,Parse,MyString,`, IfInString,A_LoopField...
by dsewq1LYJ
27 Apr 2017, 04:03
Forum: Ask For Help
Topic: Remap shift key without destroy all hotkeys of shift key
Replies: 5
Views: 639

Re: Remap shift key without destroy all hotkeys of shift key

Indeed the layout swaps, is it a solution if Autohotkey swaps it back direcly after the hotkeys is released? It's a good idea, but this cause another problem. If I tap Shift key and swap my IME to another, then if I press Shift+AnyKey then this revert my IME to the en-us, then I need to press Shift...
by dsewq1LYJ
20 Apr 2017, 22:34
Forum: Ask For Help
Topic: AHK remap glitch with percent sign
Replies: 2
Views: 370

AHK remap glitch with percent sign

5::`% Error: This line does not contain a recognized action. 5::% Error: This parameter contains a variable name missing its ending percent sign. It looks like this remap is successful, but the compiler forget it needs '`' prefix to send percent sign. but this problem can be solve by using 5::+5 Is...

Go to advanced search