javascript - InDesign Server CS6 Scripting - Get TextFrame containing DataMergeField -
i unable determine if datamergefield contained within textframe.
var document = app.open('template.indd'); var datamerge = document.datamergeproperties; var field; (field in document.datamergetextplaceholders) { var story = field.parentstory; var content = story.contents; var textframe = story.textframes.item(0); //textframe null } //....
i attempting provide wrap, fit, fill options textual contents of datamergefields, adjusting them based on textframe dimensions. without knowing of datamergefields or textframes properties used in document.
something should work in js:
var document = app.open('template.indd'); var hs = document.datamergetextplaceholders; var n = hs.length, h, tf; while (n--) { h = hs[n]; if ( h.storyoffset.parenttextframes.length ) { tf = h.storyoffset.parenttextframes[0]; //do tf } }
Comments
Post a Comment