kasper / phoenix

A lightweight macOS window and app manager scriptable with JavaScript
https://kasper.github.io/phoenix/
Other
4.38k stars 127 forks source link

Q: Is there a way to get window identifiers? #281

Closed jessie-ross closed 2 years ago

jessie-ross commented 3 years ago

Since there is no way to keep an array of window references without them becoming stale, I was wondering if there were a way to get window unique identifiers?

I am looking to be able to attach data to a specific window - i.e. I'm trying to emulate dwm and I would want to be able to tag windows.

kasper commented 3 years ago

@jessie-ross Hello, yes! Window implements Identifiable. Identifiable has the hash() function. So window.hash(). Hope that helps!