News for hackers. Stuff that matters.
Re:Making the Touch Bar useful by abandoning Apple guidelines by runjake on Wednesday April 04, 2018 @05:31PM (#16759343)
> Don't do this. Use AppleScript to watch for changes, instead of polling.

Could you provide more info about this, or even better, an actionable code example?

Re:Making the Touch Bar useful by abandoning Apple guidelines by saagarjha on Wednesday April 04, 2018 @05:51PM (#16759545)
I'm on mobile, so I can't write code for you (plus, the code is going to be ugly since it relies on a C framework). However, I can give you some pointers; one, you'll need to create some sort of app, since it will need to continuously run with a run loop. You'll want to look into the Accessibility/OSA APIs and register an AXObserver.