Copy link to clipboard
Copied
Hello,
I am trying to script a textframe location to move based on the size of the art file. Currently I move the textframe by its Geometric Bounds using the following script :
case '10':
myPage=app.activeDocument.pages.item(i).select();
myPageItems=app.documents.item(0).pages.item(i);
//Adjust Text Location
myTextFrame=myPageItems.textFrames.item("txtSUB_Slogan_Right");
myTextFrame.geometricBoundseBounds = ["142.5", "588", "225", "596"];
Break;
However when this occurs it moves the Text Frame box to the correct location but the angle of the text does not follow the Frame. So you can see the text "JAMES LANCIOTTI" moves to two lines as the text is vertical 90 Degree while the Text Frame is at 86.25 Degrees.

I would like to be able to control the text angle and placement. I think the solution might be to use a text Path but I am having trouble calling a text path by name like I did above. Any help on this would be much appreciated.
Thanks.
WPL
Copy link to clipboard
Copied
Hi WPL,
see into the properties for text frame:
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#TextFrame.html
You'll find e.g. rotationAngle.
For moving text frames around use method move().
Argument one is for moving to a point, array of x,y values.
Example:
textFrame.move( [ 5,10 ] );
Argument two is moving by values, also array of x/y values.
Example:
textFrame.move( undefined , [ 5,10 ] );
Regards,
Uwe
Copy link to clipboard
Copied
Uwe,
Thanks the move function worked and did not distort the text angle so I do not need to further change the angle. However this leads me to another followup question.
Thanks again for all the help!
WPL
Copy link to clipboard
Copied
Hi WPL,
rotationAngle is no method.
Just assign the value in degree.
Adobe InDesign CS6 (8.0) Object Model JS: TextFrame
Regards,
Uwe
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more