Search found 116 matches
- 22 Dec 2021, 06:14
- Forum: Ask for Help (v1)
- Topic: ImageSearch is not reliable compare to python's pyautogui
- Replies: 1
- Views: 798
ImageSearch is not reliable compare to python's pyautogui
Hi all. I trying to test AHK's ImageSearch to a function called locateOnScreen() from pyautogui locateOnScreen() has a interesting parameter called "confidence", it's similar idea(maybe) to ImageSearch"s *n variation argument. First of all, by using same image source, locateOnScreen() gives really r...
- 05 Nov 2021, 06:39
- Forum: Off-topic Discussion
- Topic: Any software exists to provide screen navigation via shortcut keys to overlay grid coordinates? Topic is solved
- Replies: 13
- Views: 7423
Re: Any software exists to provide screen navigation via shortcut keys to overlay grid coordinates? Topic is solved
it looks insanely useful, do you mind share some tip how to achive this?tidbit wrote: ↑27 Jun 2018, 20:42my unreleased ahk screen grid, Not sure if I want to release it or not :/
https://streamable.com/gn39d
- 21 Dec 2018, 04:22
- Forum: Ask for Help (v1)
- Topic: Dynamic global variable for GUI,Add
- Replies: 0
- Views: 627
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...
- 20 Aug 2018, 21:52
- Forum: Ask for Help (v1)
- Topic: The input issue between dictionary Topic is solved
- Replies: 2
- Views: 1085
Re: The input issue between dictionary Topic is solved
Damn man.gregster wrote:Tricky, but this works:Two " in an expression ("") create a literal " . With the integer in between you can create a string... and this gets you dict["1"]Code: Select all
dict := {"1": "foo"} Input,uin,L1 msgbox % dict["" uin ""] ExitApp
Well done. Cool sheep
- 20 Aug 2018, 21:07
- Forum: Ask for Help (v1)
- Topic: The input issue between dictionary Topic is solved
- Replies: 2
- Views: 1085
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...
- 02 Jan 2018, 07:58
- Forum: Ask for Help (v1)
- Topic: Problem with suspend mapped combinations
- Replies: 2
- Views: 960
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...
- 01 Jan 2018, 09:46
- Forum: Ask for Help (v1)
- Topic: Clipboard not work properly with ^v Topic is solved
- Replies: 2
- Views: 2129
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) {...
- 01 Jan 2018, 03:04
- Forum: Ask for Help (v1)
- Topic: Clipboard not work properly with ^v Topic is solved
- Replies: 2
- Views: 2129
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...
- 08 Dec 2017, 20:20
- Forum: Ask for Help (v1)
- Topic: Switch two applications by Send AltTab
- Replies: 0
- Views: 569
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...
- 25 Oct 2017, 09:55
- Forum: Ask for Help (v1)
- Topic: Problem with suspend mapped combinations
- Replies: 2
- Views: 960
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 ...
- 16 Oct 2017, 06:27
- Forum: Ask for Help (v1)
- Topic: Confused about Regular Expression Topic is solved
- Replies: 2
- Views: 1070
Re: Confused about Regular Expression Topic is solved
Thank you so much !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] }
It worked !
- 14 Oct 2017, 04:03
- Forum: Ask for Help (v1)
- Topic: Confused about Regular Expression Topic is solved
- Replies: 2
- Views: 1070
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...
- 07 Sep 2017, 08:50
- Forum: Ask for Help (v1)
- Topic: Error if ARRAY[i] in LIST OR if DICT[k][i] in LIST
- Replies: 2
- Views: 915
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...
- 07 Sep 2017, 01:04
- Forum: Ask for Help (v1)
- Topic: Error if ARRAY[i] in LIST OR if DICT[k][i] in LIST
- Replies: 2
- Views: 915
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...
- 08 Jun 2017, 01:13
- Forum: Ask for Help (v1)
- Topic: "AND,OR" for "if var in seq" Topic is solved
- Replies: 9
- Views: 3151
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...
- 08 Jun 2017, 01:10
- Forum: Ask for Help (v1)
- Topic: "AND,OR" for "if var in seq" Topic is solved
- Replies: 9
- Views: 3151
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...
- 07 Jun 2017, 05:31
- Forum: Ask for Help (v1)
- Topic: "AND,OR" for "if var in seq" Topic is solved
- Replies: 9
- Views: 3151
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...
- 07 Jun 2017, 04:45
- Forum: Ask for Help (v1)
- Topic: "AND,OR" for "if var in seq" Topic is solved
- Replies: 9
- Views: 3151
"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 ?
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"
}
- 16 May 2017, 06:45
- Forum: Wish List
- Topic: Improve InStr or IfInString
- Replies: 22
- Views: 10698
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,...
- 27 Apr 2017, 08:45
- Forum: Ask for Help (v1)
- Topic: Is it a bug?
- Replies: 2
- Views: 1019
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...