Search found 6783 matches

by lexikos
Today, 22:17
Forum: AutoHotkey v2 Help
Topic: A strange __set() disturbance Topic is solved
Replies: 10
Views: 3903

Re: A strange __set() disturbance Topic is solved

__set is used to override the definition of new properties by assignment. To not call it at any point where an assignment is made and the property has not previously been defined would be a loss of flexibility. If you want __set to behave differently before the object is fully constructed than after...
by lexikos
Today, 21:47
Forum: Suggestions on documentation improvements
Topic: Save file as UTF-8
Replies: 5
Views: 2076

Re: Save file as UTF-8

I think users of Windows 7, 8, 8.1, older 10 builds and editors that do not default to UTF-8 will not appreciate your point of view. You don't need to understand the recommendation to benefit from following it. The "circumstances" you mention are irrelevant to AutoHotkey scripts. Under more relevant...
by lexikos
Yesterday, 22:21
Forum: Ask For Help
Topic: Looking to make a double press of NumpadDot turn into a colon. Having some trouble.
Replies: 2
Views: 1140

Re: Looking to make a double press of NumpadDot turn into a colon. Having some trouble.

Hotstrings (as in strings of characters) are triggered by typing text, so you would have to literally type "NumpadDot, NumpadDot" as you did when you wrote the script. I use the following hotkey: ~NumpadDot:: if (A_PriorKey = "NumpadDot" && A_PriorHotkey = A_ThisHotkey && A_TimeSincePriorHotkey < 30...
by lexikos
Yesterday, 20:54
Forum: AutoHotkey v2 Development
Topic: Is it possible to keep string processing syntax consistent?
Replies: 14
Views: 4682

Re: Is it possible to keep string processing syntax consistent?

RegExMatch(), we pass in is a pattern like "\d+", so the expected result is the string that matches the pattern. The expected result is a value indicating whether the RegEx matches. If it returned the overall matched value, it would not be a boolean value, so statements such as if RegExMatch(haysta...
by lexikos
01 Aug 2020, 04:49
Forum: Bug Reports
Topic: [a118] Gui GetPos() warning for output params Topic is solved
Replies: 11
Views: 3775

Re: [a118] Gui GetPos() warning for output params Topic is solved

This does not cause a warning in v2.0-a119.
by lexikos
01 Aug 2020, 04:45
Forum: Ask For Help
Topic: Automatic inclusion doesn't work with globals
Replies: 9
Views: 3752

Re: Automatic inclusion doesn't work with globals

My suggestion was just to use the static initializer to call a function at startup. The variable which you initialize does not need to be used in any way, and the function can do whatever you want, including assign global variables.
by lexikos
01 Aug 2020, 00:58
Forum: AutoHotkey v2 Help
Topic: Click is not a function? Topic is solved
Replies: 1
Views: 724

Re: Click is not a function? Topic is solved

Click is a function, and accepts args just as you show (or concatenated). For me, the following clicks on the first tab in SciTE. I do not see how your example could do nothing ; if the array elements were not valid numbers, it would throw an exception. Otherwise, you should see the mouse move even ...
by lexikos
01 Aug 2020, 00:26
Forum: AutoHotkey v2 Development
Topic: Is it possible to keep string processing syntax consistent?
Replies: 14
Views: 4682

Re: Is it possible to keep string processing syntax consistent?

The non-RegEx equivalent of RegExMatch is InStr, which does not return a string either.
by lexikos
01 Aug 2020, 00:25
Forum: Suggestions on documentation improvements
Topic: Save file as UTF-8
Replies: 5
Views: 2076

Re: Save file as UTF-8

My recommendation for AutoHotkey v1 is still UTF-8 with BOM. UTF-8 without BOM will not work without the /cp65001 command line switch, such as with portable AutoHotkey.exe or without the UTF-8 option enabled in the installer. The top line of the FAQ does not specify with or without BOM. In all but t...
by lexikos
31 Jul 2020, 02:05
Forum: Ask For Help
Topic: Automatic inclusion doesn't work with globals
Replies: 9
Views: 3752

Re: Automatic inclusion doesn't work with globals

AutoHotkey auto-includes the file after processing the main script, during the stage that it resolves function names to addresses. The physical end of the (main) script ends the auto-execute section (as documented), so any lines added after that are not part of the auto-execute section. Ahk2Exe read...
by lexikos
30 Jul 2020, 22:46
Forum: Ask For Help
Topic: I am trying to remap my play pause button
Replies: 6
Views: 2671

Re: I am trying to remap my play pause button

A common issue is that media buttons register as "artificial", so are not considered to be "physically" down. KeyWait therefore returns immediately. You can confirm whether this is the issue by checking whether KeyHistory shows an "a" for that button. If it does, you can work around it by re-working...
by lexikos
30 Jul 2020, 22:35
Forum: Ask For Help
Topic: Automatic inclusion doesn't work with globals
Replies: 9
Views: 3752

Re: Automatic inclusion doesn't work with globals

Wrong. The assignments are included but never executed, because the file is not included within the auto execute section (on v1). I'm pretty sure enabling #Warn Unreachable would clarify this. You can use static initializers on v1 (calling an initialization subroutine from the initializer) as an alt...
by lexikos
30 Jul 2020, 03:40
Forum: Ask For Help
Topic: Can I use double {NumpadEnter} as a hotstring?
Replies: 4
Views: 1223

Re: Can I use double {NumpadEnter} as a hotstring?

A hot string is composed of text (a string of characters), and both Enter and NumpadEnter produce the same character. If it worked by keys rather than characters, it would be a hot key . However, you can use a hotstring to detect double-Enter, and then check A_PriorKey to determine whether the last ...
by lexikos
30 Jul 2020, 03:34
Forum: Ask For Help
Topic: Launching Programs with AutoHotkey causes drag and drop to stop working. Topic is solved
Replies: 5
Views: 1261

Re: Launching Programs with AutoHotkey causes drag and drop to stop working. Topic is solved

Things I've tried so far without success: ... - Running the script as admin ... - *RunAs Are you sure you weren't running the script as admin the whole time? MsgBox % A_IsAdmin You (typically) cannot drag-drop from a standard process (such as Windows Explorer) to an elevated process. If you run the...
by lexikos
30 Jul 2020, 02:39
Forum: AutoHotkey v2 Help
Topic: PageUp and PageDown stopped sending in a119
Replies: 4
Views: 1816

Re: PageUp and PageDown stopped sending in a119

PageUp and PageDown never existed in the first place.
by lexikos
29 Jul 2020, 23:10
Forum: Bug Reports
Topic: Cannot change tray icon when starting script using Task Scheduler
Replies: 14
Views: 5730

Re: Cannot change tray icon when starting script using Task Scheduler

Perhaps the system tray doesn't actually exist at the moment the logon event is raised.

In any case, I see no way that this could be a bug in AutoHotkey.
by lexikos
29 Jul 2020, 22:42
Forum: Suggestions on documentation improvements
Topic: How to prevent code execution
Replies: 8
Views: 3125

Re: How to prevent code execution

I think you've missed the point of my second paragraph. If you remove the return in v1, MsgBox still won't be called *at startup*. The return only stops it from executing *as part of the hotkey subroutine*, when you press the hotkey. Ending the hotkey function with } prior to MsgBox has the same eff...

Go to advanced search