Skip to main content
Techi_Panda
Inspiring
July 20, 2011
Answered

Read clipboard text

  • July 20, 2011
  • 2 replies
  • 1235 views

Hi scripters

Is there any commands for collect or read clipboard content in Indesign cs3 javascript.

Thanks in advance

regards

arul

This topic has been closed for replies.
Correct answer John Hawkinson

No, there is not. You'll have to call VB or AppleScript to do so, depending on your platform.

2 replies

milligramme
Inspiring
July 21, 2011

hi

I had solved similar problems with this code in the past, but this isn't so good.

var doc = app.documents[0];
var lay = doc.layers.add();
var tf = doc.textFrames.add(lay);
tf.insertionPoints[-1].select();
app.paste();

var clipboard = tf.parentStory.contents;

tf.remove();
lay.remove();
alert(clipboard);

thank you

mg.

John Hawkinson
John HawkinsonCorrect answer
Inspiring
July 20, 2011

No, there is not. You'll have to call VB or AppleScript to do so, depending on your platform.