• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Can I pull clipboard contents into a script variable ?

Advocate ,
Mar 22, 2012 Mar 22, 2012

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

TOPICS
Scripting

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 22, 2012 Mar 22, 2012

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 22, 2012 Mar 22, 2012

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines