Front Window Analysis Tool Using AppleScript System Events (List UI Elements)

You realize that there's a free version that is far more powerful than Apple's Script Editor?

Yep -- and I've got it installed on at least two machines here and another couple in the office. I've dabbled with SD since (at least!) version 4.

It's totally me -- I've just never been grabbed by it. Probably because the little AppleScripting I do is simple enough that Script Editor is more than adequate. And I'm equally sure that if I scripted more, or merely made the effort to use SD properly, I'd soon be a convert.

Fear of change + laziness == inertia :wink:

2 Likes

There is...?

@CJK, I had a play with your brilliant script and came up with something that might be worth developing.

It uses the relevant data in the output of your script to generate an AppleScript tell block.

Here's a quick demo with Logic Pro:

CleanShot 2023-09-21 at 00.27.01

I'm certain there will be circumstances under which it will fail, but I think it might have some potential.

4 Likes

I was wondering if the same script by @CJK could be used to change a macro's behaviour based on the element the mouse is hovering over

For example, in Logic I can search the results for the description "sendButton" or "audioPlugin" to see where I am in the mixer.

That worked, but it takes a few seconds to get the result, which is too long for that purpose. I'm not sure where to go from there.

As much as I hate to resort to found images, Logic's lack of scriptability often forces my hand:

Mouse Over Plugin?.kmmacros (60 KB)

Macro screenshot

Incidentally, when I ran @CJK's script, I couldn't see any reference to sendButton or audioPlugin, just button. :man_shrugging:t2:

Formatted Script Output
UI element:button 1 of group 2 of UI element 1 of UI element 1 of group 3 of list 1 of group 2 of window Untitled - Tracks of application process Logic Pro X
minimum value:missing value
orientation:missing value
position:37, 641
class:button
accessibility description:open
role description:button
focused:missing value
itle:missing value
size:32, 16
help:missing value
entire contents:
enabled:missing value
maximum value:missing value
role:AXButton
value:missing value
subrole:missing value
selected:missing value
name:missing value
description:open
AXWindow:window Untitled - Tracks of application process Logic Pro X
AXRole:AXButton
AXCustomActions:missing value
AXDescription:open
AXRoleDescription:button
AXFrame:37, 641, 69, 657
AXValue:missing value
AXParent:group 2 of UI element 1 of UI element 1 of group 3 of list 1 of group 2 of window Untitled - Tracks of application process Logic Pro X
AXTopLevelUIElement:missing value
AXSize:32, 16
AXPosition:37, 641
_AXActions:AXPress

P.S. If you want the output formatted to be more readable, as above:

Get Info for UI Element Under Mouse.kmmacros (48 KB)

Macro screenshot

1 Like

Thanks for the macros! The first one has another thing I've been looking for which is how to search the screen area around the mouse.

I believe "sendButton" or "audioPlugin" only show up on a blank slot, under "accessibility description:". BTT has conditions to scan the hovered element, but that's another app…

1 Like

I've covered plugins and sends here, in case that's of any help.

Also, PlugSearch now has lots of new handy features that are worth checking out. IMHO it's a must-have for Logic users.

1 Like

Thanks very much... I just found this Macro and it was invaluable for finding a cryptic CheckBox.
and FYI it works just fine under Sequoia