2

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!

  • Is Swift/Objective C/Cocca in Apple Script cheating? – JBis Apr 26 '18 at 21:20
  • that'd still be helpful to me if you had some sample code! I suspect that'd still be simpler than making a full dedicated Swift app, though at this point it's looking like I might have to go that route. – Chris Apr 27 '18 at 22:40
  • Not experienced in those languages, but am skilled in Apple Script an I know there’s a way to do use those languages. I left the question for someone else to pickup. – JBis Apr 27 '18 at 22:43
  • Unfortunately, no answer as been found. Heres how to do it in swift. – JBis Jun 12 '18 at 4:00

You must log in to answer this question.

Browse other questions tagged .