asmagill / hammerspoon_asm

Hammerspoon modules in progress...
MIT License
52 stars 12 forks source link

Feature Request - Return all items of same Z-order #4

Closed latenitefilms closed 8 years ago

latenitefilms commented 8 years ago

I've come across a situation where it would be awesome if axuielement:elementAtPosition(x, y | { x, y }) could return all of the elements at the same position across all Z-order levels. It would be great if you could also limit this to application.

asmagill commented 8 years ago

I'll need to check, but I believe if you use elementAtPosition as a method to an application element that it is limited to that application; the systemElementAtPosition function, on the other hand, isn't limited to a specific application since it starts with the system wide element.

As to capturing all of the elements with bounding boxes containing the point... there isn't a simple Carbon or Cocoa function (that I'm aware of) to return all of them, but it may be possible to use a filter to remove already identified objects... have to think about it because the easiest way would suffer from the same slowness we're trying to work around right now, so... I don't know... I'll keep mulling it over, though.

latenitefilms commented 8 years ago

Never mind - I thought I was running into an issue where I had interface elements "covering up" other interface elements - but I eventually worked out there was "space" where there wasn't an overlap that I could use.