Search found 591 matches
- 15 Oct 2023, 06:44
- Forum: Gaming
- Topic: Setting a macro to apply only to one application
- Replies: 4
- Views: 953
Re: Setting a macro to apply only to one application
Read https://www.autohotkey.com/docs/v2/Program.htm Here is an example script you could use or modify to do what you want #HotIf WinActive("ahk_exe TheApplicationName.exe") f1:: { static OnOff := 0 OnOff := !OnOff if OnOff SetTimer(SendV, 1000) else SetTimer(SendV, 0) } #HotIf SendV(*) { if WinActiv...
- 15 Oct 2023, 06:34
- Forum: Ask for Help (v2)
- Topic: Window focus not working with winactivate
- Replies: 8
- Views: 668
Re: Window focus not working with winactivate
If you want to set focus to a specific control in the active window use
https://www.autohotkey.com/docs/v2/lib/ControlFocus.htm
https://www.autohotkey.com/docs/v2/lib/ControlFocus.htm
- 15 Oct 2023, 06:31
- Forum: Ask for Help (v2)
- Topic: Script with hundreds of icons on a scrollable GUI crashing.
- Replies: 6
- Views: 726
Re: Script with hundreds of icons on a scrollable GUI crashing.
Thanks for troubleshooting just me. In my shortened script above using Gui Add Picture with HICON:* in this line Using gIconsDLL.Add('Picture', 'x' (mod(A_Index -1, 20) ? '+m ys' : 'm Section'), 'HICON:*' hIcon) is enough to cause the silent crash if we increase the number of icons. To reproduce tha...
- 10 Oct 2023, 12:41
- Forum: Ask for Help (v2)
- Topic: Script with hundreds of icons on a scrollable GUI crashing.
- Replies: 6
- Views: 726
Re: Script with hundreds of icons on a scrollable GUI crashing.
I can reproduce this issue. I reduced your script until the silent crash no longer happens. See below. If I uncomment the hIconPreview line the silent crash happens. I guess the script hits some memory limit. The silent crash could be a bug. Or some Gui limit to document if not already in the doc so...
- 10 Oct 2023, 06:57
- Forum: Ask for Help (v2)
- Topic: How to disable Hotkeys from inside a function Topic is solved
- Replies: 6
- Views: 562
Re: How to disable Hotkeys from inside a function Topic is solved
In addition to boiler's suggestion: If the original hotkey was created with #HotIf criteria then you need similar HotIf or HotIfWinActive in the function before the "Toggle" line.
https://www.autohotkey.com/docs/v2/lib/HotIf.htm
For example HotIfWinActive("ahk_exe MyProgram.exe")
https://www.autohotkey.com/docs/v2/lib/HotIf.htm
For example HotIfWinActive("ahk_exe MyProgram.exe")
- 09 Oct 2023, 10:25
- Forum: Ask for Help (v2)
- Topic: Pass values to a SetTimer function? Topic is solved
- Replies: 23
- Views: 1631
Re: Pass values to a SetTimer function? Topic is solved
You can Bind parameters
Code: Select all
SetTimer MyTimer.Bind("hello", "world"), 1000
MyTimer(A, B){
MsgBox A "`n" B
ExitApp
}
- 03 Oct 2023, 05:36
- Forum: Suggestions on Documentation Improvements
- Topic: V2 faq UTF8 recommendation Topic is solved
- Replies: 10
- Views: 2119
Re: V2 faq UTF8 recommendation Topic is solved
TAC109 Back in 2020 Notepad had only recently defaulted to BOM-less UTF-8. Now 3 years have passed. Windows 8 and all earlier versions are end of life. We can ask: 1. Are almost all AutoHotkey v2 users today on either Windows 10 build 1904+ or Windows 11? 2. Is there a significant number of (or eve...
- 02 Oct 2023, 06:14
- Forum: Suggestions on Documentation Improvements
- Topic: V2 faq UTF8 recommendation Topic is solved
- Replies: 10
- Views: 2119
Re: V2 faq UTF8 recommendation Topic is solved
But are such possible issues a real problem for v2 users often enough that it merits a BOM recommendation in the doc? v2 defaults to UTF-8 (without BOM) and Notepad since Windows 10 build 1903 defaults to UTF-8 (without BOM). So I'm curious if your suggestion now is prompted by some utilities/editor...
- 01 Oct 2023, 05:09
- Forum: Suggestions on Documentation Improvements
- Topic: V2 faq UTF8 recommendation Topic is solved
- Replies: 10
- Views: 2119
Re: V2 faq UTF8 recommendation Topic is solved
I know what BOM is. I wonder if there are any real world practical issues with particular utilities/editors and v2 script that you encounter that you think supports making the suggested changes? I use UTF-8 without BOM for v2 scripts and encounter no issues.
- 01 Oct 2023, 02:48
- Forum: Suggestions on Documentation Improvements
- Topic: V2 faq UTF8 recommendation Topic is solved
- Replies: 10
- Views: 2119
Re: V2 faq UTF8 recommendation Topic is solved
Which utilities/editors work better with v2 scripts saved in UTF-8 BOM?
- 01 Oct 2023, 02:42
- Forum: Ask for Help (v2)
- Topic: How to get 'case conforming' first letter for non autoreplacing hotstrings?? Topic is solved
- Replies: 11
- Views: 984
- 26 Sep 2023, 17:40
- Forum: Ask for Help (v2)
- Topic: When FileMove Fails Get Debug Error Instead of A_LastError
- Replies: 2
- Views: 317
Re: When FileMove Fails Get Debug Error Instead of A_LastError
That behaviour is as documented
https://www.autohotkey.com/docs/v2/lib/FileMove.htm#Error_Handling
https://www.autohotkey.com/docs/v2/lib/FileMove.htm#Error_Handling
You can bypass throwing error with https://www.autohotkey.com/docs/v2/lib/Try.htmAn Error is thrown if any files failed to be moved, with its Extra property set to the number of failures.
- 21 Sep 2023, 14:31
- Forum: Ask for Help (v2)
- Topic: A strange phenomenon, I don’t know if it is bug? Topic is solved
- Replies: 1
- Views: 280
Re: A strange phenomenon, I don’t know if it is bug? Topic is solved
https://www.autohotkey.com/docs/v2/Variables.htm#ThisHotkey When a hotkey is first created -- either by the Hotkey function or the double-colon syntax in the script -- its key name and the ordering of its modifier symbols becomes the permanent name of that hotkey, shared by all variants of the hotke...
- 21 Sep 2023, 12:07
- Forum: Ask for Help (v2)
- Topic: Function causes hotstring to sometimes be invisible... Topic is solved
- Replies: 4
- Views: 483
Re: Function causes hotstring to sometimes be invisible... Topic is solved
Pressing Enter after kign also causes align to type correctly. I forgot to write earlier, in my tests using Space and Enter has the same effect with your original code. That is "kign<Enter>align<Enter>" becomes "king<linebreak>aling<linebreak>". I think the issue is that the recognizer doesn't dete...
- 21 Sep 2023, 10:44
- Forum: Ask for Help (v2)
- Topic: Function causes hotstring to sometimes be invisible... Topic is solved
- Replies: 4
- Views: 483
Re: Function causes hotstring to sometimes be invisible... Topic is solved
I think when you type the space in kign align hotstring :X?:ign:: is triggered and replaces kign with king . The hotstring recognizer does not count the ending character space as a non-word character and therefore as you continue to type recognizes <wordchar>align which does not trigger ::align:: (b...
- 20 Sep 2023, 13:59
- Forum: Ask for Help (v2)
- Topic: How to calculate the screen space occupied by characters? Topic is solved
- Replies: 14
- Views: 1233
- 20 Sep 2023, 03:10
- Forum: Ask for Help (v2)
- Topic: What is the best JSON parser/stringify library to use with AHK 2? I'm so confused. Topic is solved
- Replies: 9
- Views: 1320
Re: What is the best JSON parser/stringify library to use with AHK 2? I'm so confused. Topic is solved
There is also
https://github.com/thqby/ahk2_lib/blob/master/JSON.ahk
which is pure AHK (no .dll dependencies, unlike cpp-json also by thqby)
https://github.com/thqby/ahk2_lib/blob/master/JSON.ahk
which is pure AHK (no .dll dependencies, unlike cpp-json also by thqby)
- 18 Sep 2023, 11:51
- Forum: Scripts and Functions (v2)
- Topic: WebSocket client (Implemented via winhttp)
- Replies: 24
- Views: 4331
Re: WebSocket client (Implemented via winhttp)
I didn't know that, thanks! With flags /FAc /O2 /GC- I get this https://www.godbolt.org/z/E16cYjYKr from which we can parse hex mcode 4883EC484C8BD24181F80000080074094181F8000000047530488B028B52184C894C24304533C94181F80000080048894C2428498B4A084C8D442420410F94C1488944242041FF52104883C448C3 which whe...
- 18 Sep 2023, 10:52
- Forum: Scripts and Functions (v2)
- Topic: WebSocket client (Implemented via winhttp)
- Replies: 24
- Views: 4331
Re: WebSocket client (Implemented via winhttp)
I'm trying to reproduce the x64 mcode embedded in WebSocket.ahk Base64 SIPsSEyL0kGB+AAACAB0CUGB+AAAAAR1MEiLAotSGEyJTCQwRTPJQYH4AAAIAEiJTCQoSYtKCEyNRCQgQQ+UwUiJRCQgQf9SEEiDxEjD which converts to HEX 4883EC484C8BD24181F80000080074094181F8000000047530488B028B52184C894C24304533C94181F80000080048894C2428...
- 18 Sep 2023, 03:50
- Forum: General Discussion
- Topic: AutoHotkey v2 Help
- Replies: 4
- Views: 1310
Re: AutoHotkey v2 Help
LAPIII this chm_config.js data works on my PC to make help start with tab "Search" focused and dark mode config = { "fontSize": 1, "clickTab": 2, "displaySidebar": true, "colorTheme": 1, "collapseQuickRef": 1 } For anyone else reading this thread: to get to the page where the options file is genera...