Search found 9391 matches

by lexikos
Today, 05:24
Forum: AutoHotkey Development
Topic: What to do when "A" getting the current active window misses?
Replies: 11
Views: 1050

Re: What to do when "A" getting the current active window misses?

There isn't any real code to bring a window of type "A" into existence, There absolutely is. WinActivate. Run. Anything else that activates a window. :roll: In addition, it seems to be a type mismatch 99% of the time as when "A" is not found, I can clearly see the window I intend to target, it just...
by lexikos
Today, 05:04
Forum: Ask for Help (v2)
Topic: Run "i_view64.exe" and other programs moving the mouse cursor?!
Replies: 6
Views: 107

Re: Run "i_view64.exe" and other programs moving the mouse cursor?!

Found this strange effect -> Run starts the program and moves the mouse cursor to the just opened window , which I don't like! This has nothing to do with Run. Run just starts the program. I'll bet it happens when any new window opens, not just when a program starts, or when AutoHotkey starts a pro...
by lexikos
20 Apr 2024, 08:43
Forum: Bug Reports
Topic: COM: Table Manipulation in MS Word broken in recent AHK versions
Replies: 9
Views: 323

Re: COM: Table Manipulation in MS Word broken in recent AHK versions

Descolada I presume you are thinking that oWord.application.documents.item(1).activate should behave as though there was () at the end. Which part of the documentation tells you that it should work that way? I assume the thrown error is due to activate being a method, while you are getting a proper...
by lexikos
20 Apr 2024, 08:34
Forum: Bug Reports
Topic: inputOpj.EndKey
Replies: 3
Views: 93

Re: inputOpj.EndKey

GetKeyName is most definitely entirely dependent on the keyboard layout for single-character key names. If the VK is not between A (vk41) and Z (vk5A), it uses MapVirtualKeyEx to retrieve the corresponding character, according to the keyboard layout. For the A - Z keys (which MapVirtualKeyEx always ...
by lexikos
20 Apr 2024, 08:09
Forum: AutoHotkey Development
Topic: What to do when "A" getting the current active window misses?
Replies: 11
Views: 1050

Re: What to do when "A" getting the current active window misses?

Everything you do with window, keyboard or mouse automation is prone to race conditions and conflicts, since forces outside the script, like the user himself, can affect the state of the window. "A" is no different to any other window specification in that respect. NOTE: "A" intentionally does not m...
by lexikos
20 Apr 2024, 06:54
Forum: Announcements
Topic: v2.0.13
Replies: 13
Views: 25458

v2.0.13

Changed Hotkey function to throw ValueError if Options contains an invalid option. Fixed InputHook to respect the +S option for Backspace when acting as undo. Fixed debugger to safely handle property deletion during enumeration. Fixed OLE clipboard content (e.g. error dialog text) being lost on exit...
by lexikos
12 Apr 2024, 04:11
Forum: Bug Reports
Topic: InputHook does not exclude suppression for ENTER key
Replies: 2
Views: 84

Re: InputHook does not exclude suppression for ENTER key

Strictly speaking, it may be behaving as documented. Specify the string {All} (case-insensitive) on its own to apply KeyOptions to all VK and all SC ... When a key is specified by name, the options are set either by VK or by SC. Where two physical keys share the same VK but differ by SC (such as Up ...
by lexikos
12 Apr 2024, 02:39
Forum: Ask for Help (v2)
Topic: How to call nested function? Topic is solved
Replies: 15
Views: 300

Re: How to call nested function? Topic is solved

jsong55 Do you want us to guess at the structure of your script, like we had to guess at what you were trying to do? Don't use SendMessage to call your own function. If you want your function to be callable from outside the function, either just don't put it inside the function, or pass it out some...
by lexikos
11 Apr 2024, 23:37
Forum: Ask for Help (v2)
Topic: Need help fixing script to disable only the built-in keyboard
Replies: 2
Views: 86

Re: Need help fixing script to disable only the built-in keyboard

It is apparently possible by combining a keyboard hook with Raw Input (HID). Confirming whether it can be done within the context of AutoHotkey has been on my TODO list for years.
viewtopic.php?f=13&t=9651
by lexikos
11 Apr 2024, 23:32
Forum: Ask for Help (v2)
Topic: How to call nested function? Topic is solved
Replies: 15
Views: 300

Re: How to call nested function? Topic is solved

The simplest answer to "How to call nested function?" is literally fn2() within f1 . What niCode demonstrated is not something I would ever suggest doing in a real script. A more typical use of a nested function would be to return it , as in the first closure example . The caller can then assign the...
by lexikos
11 Apr 2024, 22:48
Forum: Ask for Help (v2)
Topic: Fill edit field in GUI using functions
Replies: 3
Views: 75

Re: Fill edit field in GUI using functions

But MyMainWindow is a global variable... You could do this: LogToWindow := MainWindow() Sleep(1000) LogToWindow('hello') Sleep(1000) LogToWindow('hey') class MainWindow extends Gui { __new() { super.__new(,"WIM AutoUpdate") this.SetFont("s9","Segoe UI") this.Add("Edit", "x8 y56 w736 h312 +ReadOnly +...
by lexikos
11 Apr 2024, 22:16
Forum: Ask for Help (v2)
Topic: "Expected a string, but got a function..."
Replies: 2
Views: 123

Re: "Expected a string, but got a function..."

Even in cases where it is valid to omit the parentheses, it is not valid to write a comma immediately after the function/method name. Comma is used only between parameters or to separate sub-expressions, as in x := 1, y := 2 . MsgBox, "Invalid" Global variables being directly assigned by a function ...
by lexikos
11 Apr 2024, 22:04
Forum: Ask for Help (v2)
Topic: Substitute of v. 1 SetBatchLines
Replies: 5
Views: 129

Re: Substitute of v. 1 SetBatchLines

SetTimer batchLines, 10 can be replaced with SetTimer Sleep.Bind(15), 10, which has the benefit of not logged the Sleep call into ListLines. However, you will not be able to turn it off unless you retain a reference (SetTimer batchLines := Sleep.Bind(15), 10 ... SetTimer batchLines, 0).
by lexikos
11 Apr 2024, 21:57
Forum: Ask for Help (v2)
Topic: why v2 script trigger popup menu in onenote?
Replies: 17
Views: 264

Re: why v2 script trigger popup menu in onenote?

Try SendEvent "^c" or $#v:: . When you test with Send/SendInput, ensure that there are no other running scripts which have keyboard hooks installed. Other programs which install global keyboard hooks may also affect the result. Just wondering why the difference between v1 and v2 scripts considering ...
by lexikos
11 Apr 2024, 21:34
Forum: Bug Reports
Topic: inputOpj.EndKey
Replies: 3
Views: 93

Re: inputOpj.EndKey

If I'm understanding you correctly, you are getting Farsi letters from EndKey but you are not expecting Farsi letters. So what are you expecting? Keys which correspond to individual characters are "named" by the character that they produce, which depends on keyboard layout. If I'm understanding you ...
by lexikos
11 Apr 2024, 21:30
Forum: Bug Reports
Topic: an issue on "~!= Up::Ctrl"
Replies: 2
Views: 117

Re: an issue on "~!= Up::Ctrl"

The only bug here is that ~!= Up::Ctrl is not flagged as an error. The purpose of a remapping is to remap one key to another, not the release of a key to another key.

This is probably what you want:

Code: Select all

*~!= Up::Send "{Blind}{Ctrl}"
by lexikos
11 Apr 2024, 21:22
Forum: Ask for Help (v2)
Topic: why v2 script trigger popup menu in onenote?
Replies: 17
Views: 264

Re: why v2 script trigger popup menu in onenote?

Please confirm that you are using the latest version of v2; i.e. v2.0.12 at this time (or v2.1-alpha.9 if you are using v2.1).
by lexikos
11 Apr 2024, 21:19
Forum: Bug Reports
Topic: SetTitleMatchMode Regex + i) option failing
Replies: 11
Views: 219

Re: SetTitleMatchMode Regex + i) option failing

each part of the title match (ahk_class, ahk_exe) will have its own options so to speak, which is a bit strange as this would be an invalid i)testing ahk_class i)AutoHotkey.* Regex string in any other circumstance. Personally I think your perspective is a bit strange. WinTitle is clearly not a rege...
by lexikos
11 Apr 2024, 21:06
Forum: Bug Reports
Topic: COM: Table Manipulation in MS Word broken in recent AHK versions
Replies: 9
Views: 323

Re: COM: Table Manipulation in MS Word broken in recent AHK versions

Tables is a property with no parameters. Item is a method. document.Tables[1] is property retrieval. It is a single operation where a property Tables is invoked with parameter 1. How it is dispatched depends on the implementation of the object. I can offer some conjecture based on "Item" is not a pr...
by lexikos
11 Apr 2024, 19:31
Forum: Ask for Help (v2)
Topic: how could I get a script to automatically reload upon waking up my computer?
Replies: 6
Views: 224

Re: how could I get a script to automatically reload upon waking up my computer?

It is also of some concern that message processing in the application must return True to the operating system. "An application should return TRUE if it processes this message." It doesn't specify what constitutes "processing", or that it should ever return FALSE, or that the return value is used i...

Go to advanced search