Search found 1143 matches

by Descolada
39 minutes ago
Forum: Scripts and Functions (v2)
Topic: UIA v2
Replies: 363
Views: 49458

Re: UIA v2

shipaddicted I'm not aware of any UIA method capable of resizing an element. Since you are dealing with a website I'd recommend Javascript injection via the address bar, which would probably be fastest and most reliable. Alternatively if the Edit field can be resized by dragging it from the corner,...
by Descolada
56 minutes ago
Forum: Scripts and Functions (v2)
Topic: Easy OCR
Replies: 93
Views: 16992

Re: Easy OCR

Starkom perhaps something like this: #Requires AutoHotkey v2 #include <OCR> result := OCR.FromRect(406, 261, 87, 36, "en-us") MsgBox eval(RegExReplace(result.Text, "[^\d-+*\\]")) ; Source: https://github.com/TheArkive/eval_ahk2/blob/master/_eval.ahk ; ===============================================...
by Descolada
24 Apr 2024, 10:55
Forum: Ask for Help (v1)
Topic: RE: DllCall with SharedVar application
Replies: 4
Views: 240

Re: RE: DllCall with SharedVar application

DllCall's default return type is a 32-bit integer, but looking at the expected version number format it looks like a string. Try specifying "str" as the return type (or wstr/astr).
by Descolada
24 Apr 2024, 00:38
Forum: Scripts and Functions (v2)
Topic: UIA v2
Replies: 363
Views: 49458

Re: UIA v2

shipaddicted unfortunately I don't have access to Salesforce so I can't debug this myself. It sounds like either a wrong element is found inside the switch statement, or it is a timing issue. My first suggestion is to add some Highlights to see whether everything lights up correctly: ;'open' 2nd co...
by Descolada
23 Apr 2024, 13:18
Forum: Tutorials (v1)
Topic: FindText tutorial
Replies: 98
Views: 66193

Re: FindText tutorial

@kashmirLZ just add some value to one/both of the coordinates, eg FindText().Click(X + 100, Y) offsets 100 pixels to the right.
by Descolada
22 Apr 2024, 22:43
Forum: Scripts and Functions (v2)
Topic: Easy OCR
Replies: 93
Views: 16992

Re: Easy OCR

@Carrottie probably because the window opened by Run "https:\\contacts.google.com" isn't titled "HTML input type". You need to change the WinWaitActive and WinActive arguments as well to match your target window title (or remove the check and replace that part with a small sleep).
by Descolada
20 Apr 2024, 23:38
Forum: Ask for Help (v2)
Topic: Help updaing simple script to AHK 2.0
Replies: 7
Views: 231

Re: Help updaing simple script to AHK 2.0

Pyper , it appears that ControlSend doesn't work for all hotkeys: it worked for F2, but not 2. Try this instead: #Requires AutoHotkey v2 ;REPLACE "g" with your desired hold key for maps ;REPLACE "{F24}" with your desired hotkey sent to OBS for show/hiding effect or source. This cannot include modif...
by Descolada
20 Apr 2024, 23:08
Forum: Ask for Help (v2)
Topic: How to use Window Spy with multiple monitors
Replies: 21
Views: 258

Re: How to use Window Spy with multiple monitors

drbobsing 1. AHK is by default DPI system aware, meaning it thinks the screen scaling of the main monitor is the screen scaling of all monitors. If that is not the case then you will get weird coordinates or "jumps" in coordinates between monitors. To fix this, add DllCall("SetThreadDpiAwarenessCon...
by Descolada
20 Apr 2024, 10:00
Forum: AutoHotkey Development
Topic: What to do when "A" getting the current active window misses?
Replies: 11
Views: 1313

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

How can it guarantee that, when the last found window might have been destroyed ? True, few, if any things related to interacting with external applications can be guaranteed. It is only a subjectively much more smaller probability that it fails, as the timeframe between the two calls is miniscule....
by Descolada
20 Apr 2024, 09:17
Forum: Bug Reports
Topic: COM: Table Manipulation in MS Word broken in recent AHK versions
Replies: 10
Views: 436

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 am indeed thinking that, and no part of the documentation tells me that. The documentati...
by Descolada
20 Apr 2024, 09:00
Forum: Scripts and Functions (v2)
Topic: Easy OCR
Replies: 93
Views: 16992

Re: Easy OCR

@pho7271 I've noticed the UWP OCR engine has trouble detecting white text on bright colors, so that word might not be detected. Check the output of result.Text whether it contains it altogether or not, and if it doesn't then of course FindString can't find it either.
by Descolada
20 Apr 2024, 03:05
Forum: Ask for Help (v2)
Topic: CaretGetPos not working in Chrome?
Replies: 2
Views: 60

Re: CaretGetPos not working in Chrome?

Try this instead: /** * Gets the position of the caret with UIA, Acc or CaretGetPos. * Credit: plankoe (https://www.reddit.com/r/AutoHotkey/comments/ysuawq/get_the_caret_location_in_any_program/) * @param X Value is set to the screen X-coordinate of the caret * @param Y Value is set to the screen Y-...
by Descolada
20 Apr 2024, 01:18
Forum: Tutorials (v1)
Topic: FindText tutorial
Replies: 98
Views: 66193

Re: FindText tutorial

@kashmirLZ you can define your text as text := "|<close1>*80$47.zzzzz...zw|<close2>*85$51.zz...zzzU|<close3>*68$46.zzzz...zzy|<close4>*70$48.zzzz...zzU" and if you use FindText with it then it will match any of the variations.
by Descolada
20 Apr 2024, 01:15
Forum: Ask for Help (v2)
Topic: Help updaing simple script to AHK 2.0
Replies: 7
Views: 231

Re: Help updaing simple script to AHK 2.0

Pyper this seemed to work in OBS: #Requires AutoHotkey v2 ;REPLACE "g" with your desired hold key for maps ;REPLACE "{F24}" with your desired hotkey sent to OBS for show/hiding effect or source. This cannot include modifier keys, so use F13-F24. ~g::{ ControlSend("{F24}", , "ahk_exe obs64.exe") Key...
by Descolada
20 Apr 2024, 00:53
Forum: Scripts and Functions (v2)
Topic: Easy OCR
Replies: 93
Views: 16992

Re: Easy OCR

@Carrottie, make sure you have the latest version of OCR.ahk and the latest Example files. If the issue still persists, please PM me your AHK version number, Windows version, and the library folder packaged into a zip file.
by Descolada
19 Apr 2024, 10:48
Forum: Scripts and Functions (v2)
Topic: UIA v2
Replies: 363
Views: 49458

Re: UIA v2

gongnl 1. Try using DumpAll() on the website and see whether the output contains something resembling the hidden element (eg an element with the name "isWriteOff"). UIA is mostly meant for visible UI elements so a hidden one might not be detectable though, in which case you'd probably need to injec...
by Descolada
19 Apr 2024, 10:40
Forum: Scripts and Functions (v2)
Topic: Easy OCR
Replies: 93
Views: 16992

Re: Easy OCR

pho7271 it appears that one Chinese character is considered a "word" by the Windows OCR engine. This means that the OCR engine reports for example two words "我" and "不", but they won't be matched if the needle is "我不" (one word). Currently the way around this is to separate the characters in the ne...
by Descolada
18 Apr 2024, 10:45
Forum: Scripts and Functions (v2)
Topic: UIA v2
Replies: 363
Views: 49458

Re: UIA v2

gongnl try this: #Requires AutoHotkey v2 #include UIA.ahk browser := UIA.ElementFromHandle("ahk_exe vivaldi.exe") handler := UIA.CreateAutomationEventHandler(AsyncContentLoadedEvent) UIA.AddAutomationEventHandler(handler, browser, UIA.Event.AsyncContentLoaded) Persistent AsyncContentLoadedEvent(doc...
by Descolada
18 Apr 2024, 10:31
Forum: Wish List
Topic: Notify if not UTF-8?
Replies: 3
Views: 112

Re: Notify if not UTF-8?

I third that. AHK v2 is Unicode-only, so it makes sense to coerce the user into using the proper encoding for that. Perhaps it should be a #Warn directive such as #Warn FileEncoding (I chose "FileEncoding" to be consistent with A_FileEncoding ), which would display something like "The script file(s)...
by Descolada
18 Apr 2024, 07:06
Forum: Scripts and Functions (v2)
Topic: Easy OCR
Replies: 93
Views: 16992

Re: Easy OCR

Carrottie there are two possible problems with your code: 1. Run doesn't wait for the website to load, so FromDesktop might not capture the page you want to capture 2. Click uses coordinates relative to the window by default, whereas FromDesktop returns coordinates relative to screen. You might wan...

Go to advanced search