Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save indiscripts/8a920d3cbff0b568f35cc85d7b40add1 to your computer and use it in GitHub Desktop.
Save indiscripts/8a920d3cbff0b568f35cc85d7b40add1 to your computer and use it in GitHub Desktop.
// Assuming a text is selected (or cursor positioned) in a TextFrame.
// ---
var tf = app.selection[0].parentTextFrames[0];
alert( tf.constructor.name ); // => TextFrame expected.
var dup = tf.duplicate(); // Duplicate the frame
dup.properties = { // Assign some props
contents:'test',
textFramePreferences:{ignoreWrap:true},
locked:false
};
dup.exportFile( ExportFormat.INDESIGN_SNIPPET, File("~/test.idms"), false );
// => "The Specified Object does not support the desired export format"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment