Quantcast
Channel: AutoHotkey Community
Viewing all articles
Browse latest Browse all 579

Scripts and Functions (v2) • Re: UIA v2

$
0
0
@cgx5871
Is line 2519 wrong? Func Click()
} else if ClickCount > 9 {
SleepTime := cCount, cCount := 1
}
Should SleepTime := ClickCount ?

It is not wrong, cCount == ClickCount. Although using the variable cCount is superfluous, so I'll remove it in the next update. Since Click is almost never used to click more than twice (a double-click) then a ClickCount greater than 9 will be treated as a sleep duration instead, meaning El.Click("left", 10) will sleep 10ms after clicking.

Element---targetEl a little confused

path := Element.GetConditionPath(targetEl) outputs a path such that Element[path*] == targetEl. UIAViewer outputs paths starting from the window element, but a path can actually start from any element and reach any of its descendants.

NotionEl := UIA.ElementFromHandle("ahk_exe Notion.exe")

Should we cache hwnd directly?
Then use "ei.ConditionPath" to directly retrieve the path. Would it be more convenient?

I don't understand the question. You can use NotionEl as the starting point if you are sure that UIA.SmallestElementFromPoint() will return an element that is inside Notion window, meaning that you have validated that the cursor is inside Notion, otherwise no path can be generated.

Statistics: Posted by Descolada — Today, 11:05



Viewing all articles
Browse latest Browse all 579

Trending Articles