Is it possible to intercept global copy and paste in OS X with an AppleScript? Or would I have to have some intermediary step that would trigger the AppleScript to read the clipboard?
A:
They way I do it in Applescript is with the following command:
get the clipboard
You could of course then do stuff like setting it to a variable and displaying it:
set xyz to the clipboard
display alert (xyz as text)
Hope that helps!
Elliott
Elliott Bowles
2009-09-17 05:47:48
@Elliott, that does help, thank you. Now how would I get this script to run the moment I copied something to the clipboard?
Kyle Hayes
2009-09-18 15:06:18
Hmm, that's a tricky question. I'm afraid I don't have a great answer for you on that. The best way to do something similar if you have OSX 10.6 is create a service using automator, put your applescript in as part of the action, and then assign it to a keyboard shortcut. That would get rid of some of the intermediate steps...
Elliott Bowles
2009-10-20 04:56:33
That's not a bad idea. I'll look into that. Thanks for the help!
Kyle Hayes
2009-11-05 22:28:28
A:
Hi,
I am trying to look into doing something of the same kind. I want to intercept a copy paste application to a folder. Did you manage to get a breakthrough? If yes, could you please help m e out here by letting me know how you managed to get it done.
Thanks a lot.
outis
2009-12-21 02:17:47