• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Resized anchored Text Frame (expanded to fit overset content) overlaps following text

New Here ,
Aug 14, 2024 Aug 14, 2024

Copy link to clipboard

Copied

I'm new to UXP and the InDesign DOM and trying to write a script that will resize overset anchored Text Frames.

A snippet of my code:

thisTextFrame.fit(myInDesign.FitOptions.FRAME_TO_CONTENT);

https://developer.adobe.com/indesign/dom/api/f/FitOptions/

This successfully increases the text frame's height, but the text now overlaps the text in the Story that follows the anchored Text Frame.

Is there a way of pushing the Story text down so that it follows the expanded TextFrame?

If I manually drag the Text Frame in InDesign to resize it, the Story text gets pushed down. I'd like to be able to automate this with a script.

Many thanks for any advice that can help me make progress.

TOPICS
How to , Scripting , UXP Scripting

Views

78

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 14, 2024 Aug 14, 2024

Copy link to clipboard

Copied

If I am understanding you correctly you have an inline text frame inside the text of another text frame. I set one of these up and the fit frame to content had the same issue outside of scripting. Instead of using the fit options, maybe try setting the text frames autoSizingType inside of its textFramePreference. Set it to height only.

https://developer.adobe.com/indesign/dom/api/t/TextFramePreference/

Here are the options for the autoSizingType.

https://developer.adobe.com/indesign/dom/api/a/AutoSizingTypeEnum/

The other options would be to not have the text frame inline and set the textWrapPreferences to have the story text to a specific space away from the text frame. Then you should be able to set the fit option and the story text should fall in line.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 15, 2024 Aug 15, 2024

Copy link to clipboard

Copied

LATEST

Many thanks for your advice.

Using textFramePreference has the same effect on an inline object.

thisTextFrame.textFramePreferences.autoSizingType = myInDesign.AutoSizingTypeEnum.HEIGHT_ONLY;

So now I am looking at not having the text frame inline, as you suggest.

I'm thinking about scripting this using

thisTextFrame.anchoredObjectSettings.releaseAnchoredObject();

but this is having no effect.

(Referring to https://forums.creativeclouddeveloper.com/t/cant-figure-out-how-to-move-an-anchored-text-frame-out-o...

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines