Copy link to clipboard
Copied
Hi,
I have an Indesign document that contains anchored text frames within a number of linked text frames.
I run an extendscript that adjusts the width of the anchored text frame to the width of the frame where it is embedded and applies an object style to it.
This is the code:
for (var i = 0; i < doc.allPageItems.length; i++) {
tf = doc.allPageItems[i];
if( tf.constructor.name == 'TextFrame') {
var hasBorder = tf.extractLabel("hasBorder");
if( hasBorder == 'true' ) {
tf.appliedObjectStyle = doc.objectStyles.itemByName("rahmen");
if( tf.parent.constructor.name == "Character" )
{
var parentFrameWidth = getTextFrameWidth(tf.parent.parentTextFrames[0]) ;
var borderedFrameWidthInmm = parentFrameWidth + 'mm';
setWidthHeight( tf, borderedFrameWidthInmm, '10mm' );
tf.appliedObjectStyle = doc.objectStyles.itemByName("rahmen");
}
}
}
}After executing the extendscript, the document looks like this:
When I select the frame I can see, that the correct object style is applied.
But the anchored text frame is too long and should be shifted to the next linked text frame, like this:
I get this result, when I manually apply the object style to the frame, but not when I do it using extendscript.
Any ideas, what could be the problem ?
Hi Mike,
you could recompose the story.
http://jongware.mit.edu/idcs6js/pc_Story.html#recompose
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Hi Mike,
you could recompose the story.
http://jongware.mit.edu/idcs6js/pc_Story.html#recompose
Regards,
Uwe Laubender
( ACP )
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more