Copy link to clipboard
Copied
Hi,
I have not found any reference to the clipboard in the specs, except that you can copy and paste stuff from and into an FM document. I want to pull text from the clipboard and do some processing to it before pasting it into the FM document. Is there a way to do this ? It seems rather clumsy to first paste the clipboard into a document, then retrieve the text from that document so that I have it in script variables, then delete the new content from the FM document and bit by bit re-insert the text into the document with the correct element tags etc.
Thanks for any help / suggestions
Jang
Copy link to clipboard
Copied
Hi Jang,
I found this two links in Photoshop Forum:
http://huddledmasses.org/clipexe-and-the-missing-pasteexe/
Hope this helps.
Markus
Copy link to clipboard
Copied
Hi Markus,
That just confirms there is no easy way to do it. I have created my script using the clumsy-looking but apparently necessary method that I described: create a new empty element, paste the clipboard contents into it, reading the text into a variable using GetText on the new element, deleting the element again, processing the text to get the strings I want and finally inserting new elements and pushing the strings into them using AddText. A lot of code for something that should be easy.
Checking on methods to access the clipboard from JavaScript confirms that most programs have a very roundabout way of doing this, if they allow it at all. Oh well, I got it working in my particular case.
Ciao
Jang