Skip navigation
Rom B
Currently Being Moderated

smartTextReflow & invalid object for this request

Jul 16, 2012 8:23 AM

Tags: #script #indesign #recompose #geometric_bounds #smart_text_reflow #smarttextreflow #geometricbounds #invalid_object_for_this_request

Hi,

 

I'm scripting an import of xml files into inDesign. To add pages I use the smartTextReflow feature:

 

myDocument.textPreferences.smartTextReflow = true;

myDocument.recompose();

 

Further on the script I want to get the geometricBounds of some graphics:

 

graphic.parent.geometricBounds[1];

 

This two steps are working well when I launch the script from ExtendScript Toolkit. But when the script is launched from inDesign, I get this error about geometricBounds: "Invalid object for this request".

It looks like recompose() does not work from inDesign, while it does from ExtendScript Toolkit... I'm kind of struggling with this problem for some hours now.

 

Let me know if you need more informations and thanks for your help :-)

 
Replies
  • Currently Being Moderated
    Jul 16, 2012 10:22 AM   in reply to Rom B

    recompose() should work the same whether the script is called from InDesign or the ESTK. Maybe you should post a minimal but complete script that demonstrates the problem. Also tell us what version you're using.

     

    Jeff

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 18, 2012 9:19 AM   in reply to Rom B

    Thank you for providing more information, but I'm afraid I still don't know what to tell you.

     

    A few thoughts:

    1. I don't have a lot of experience with smart text reflow in a scripted setting, but I have used it and haven't seen the race condition-type problem it seems like you're seeing.

    2. The specific error ("Invalid object for this request") you're seeing when trying to access an inline rectangle's geometricBounds is because the rectangle is in the overset portion of the story. I think you already know this.

    3. recompose() definitely exists in the desktop version—or you would get an error calling it. I normally call it on a story rather than entire document though. You should probably call it at the end of each iteration of your inline rectangle resizing loop if you're seeing these problems.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 19, 2012 8:34 AM   in reply to Rom B

    Did you try putting a recompose() in each iteration of your resizing loop?

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points