@Descolada Everything is working great, great tool!
Two Questions if you have time.
1. When you created the TreeWalker, Can you go to the
2nd or 3rd sibling? not just the
next or
previous? I'll paste the Next Sibling code below for your convenience.
2. In the inspector.exe tool when you click on the Rectangle icon
'watch focus' button only and not the 'watch cursor', it gives you access to a few more spots (in Davinci for example) that the watch Cursor can't.
But I can't use the data from it, for example, the AutomationID.
If you see the pictures below. I used it to separate the Video and Audion panels, normally they are one big Panel. But any data given by the
'watch focus' method doesn't do anything even though it shows you a unique
AutomationID.
Is it possible? It would be a great help for me in automating.
- Video Layer only.jpg (22.11 KiB) Viewed 1713 times
Code: Select all
#include <UIA_Interface>
UIA := UIA_Interface()
WinActivate, DaVinci Resolve
WinWaitActive, DaVinci Resolve
davinci := UIA.ElementFromHandle(WinExist("DaVinci Resolve"))
XText := davinci.FindFirstByNameAndType("X", "Text")
tw := UIA.CreateTreeWalker(UIA.CreateCondition("ControlType", "Text"))
XValue := tw.GetNextSiblingElement(XText)
XValueCoords := XValue.CurrentBoundingRectangle
CoordMode, Mouse, Screen
Click, % (XValueCoords.l+((XValueCoords.r-XValueCoords.l) // 2)) " " (XValueCoords.t + ((XValueCoords.b-XValueCoords.t)//2)) " " 2