I'd like to do something whenever clipboard content changes. I have a solution working now where I get the clipboard value and store it, then I start an infinite loop where I look up the clipboard again, see if it's changed, then sleep for 0.5s and do it all over again.
This definitely works, but I want to do this better! Would prefer if I can listen for a notification that just tells me when the clipboard changes. There's a
UIPasteboardChanged event in UIKit that lets you do this, but would prefer not needing to write this in Swift code to accomplish my goal. :-)
Any ideas on how to do this in Applescript/Automator/Python? Thanks!