Created
November 18, 2015 15:39
-
-
Save grefel/f1424c3a73f34e75b789 to your computer and use it in GitHub Desktop.
Read clipboard contents with InDesign
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
var pstwp = app.clipboardPreferences.preferStyledTextWhenPasting; | |
app.clipboardPreferences.preferStyledTextWhenPasting = false; | |
var doc = app.documents[0]; | |
var typoQ = doc.textPreferences.typographersQuotes; | |
doc.textPreferences.typographersQuotes = false; | |
var tf = doc.textFrames.add(); | |
tf.insertionPoints[-1].select(); | |
app.paste(); | |
var clipboard = tf.parentStory.contents; | |
$.writeln(clipboard); | |
} | |
catch (e) { | |
alert (e + " \nLine " + e.line); | |
} | |
finally { | |
app.clipboardPreferences.preferStyledTextWhenPasting = pstwp; | |
doc.textPreferences.typographersQuotes = typoQ; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
found a better solution from harbs:
https://forums.adobe.com/thread/2022613