Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hash/identifier for userdata objects for hs.axuielement to allow usage as table keys? #3532

Open
pitkling opened this issue Sep 5, 2023 · 0 comments

Comments

@pitkling
Copy link

pitkling commented Sep 5, 2023

I'm relatively new to Lua and recently realized that for userdata objects like axuielementObject given something like

systemElement  = hs.axuielement.systemWideElement()
currentElement1 = systemElement:attributeValue("AXFocusedUIElement")
currentElement2 = systemElement:attributeValue("AXFocusedUIElement")

the comparison currentElment1 == currentElement2 would return true, while after

table[currentElement1] = true

the entry table[currentElement2] is still nil. After doing some reading I see why, but I wonder whether there is some way to still use such axuielementObject objects as table keys? Something like currentElement1.id() or currentElement1.hash() that would uniquely identify a given ui element and could be used as table keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant