views:

409

answers:

2

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
@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
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
That's not a bad idea. I'll look into that. Thanks for the help!
Kyle Hayes
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