Skip navigation
Currently Being Moderated

textFrame.fit() in CS6

May 23, 2012 1:47 PM

So, I had a minute and wanted to test the new auto-fitting text frames against the usual textFrame.fit(FitOptions.FRAME_TO_CONTENT) from a performance standpoint.

 

The auto-fitting seemed to work fine in very limited testing. When I went to compare the older method, with auto-fitting turned off, I started with this:

 

Screen shot 2012-05-23 at 3.24.03 PM.PNG

 

The repeated part of my script looked like this:

 

var frame = app.activeDocument.textFrames[0];
frame.contents += frame.contents;
frame.fit(FitOptions.FRAME_TO_CONTENT);

 

I got this:

 

Screen shot 2012-05-23 at 3.24.40 PM.PNG

 

Uh oh. The frame resized out to the pasteboard margins.

 

It works fine, as it always has, in the UI. And it will do okay from the scripting interface with two different scripts:

 

var frame = app.activeDocument.textFrames[0];
frame.contents += frame.contents;

 

and then:

 

var frame = app.activeDocument.textFrames[0];
frame.fit(FitOptions.FRAME_TO_CONTENT);

 

But not together. I tried putting in an alert and some other stuff in between the text doubling and the fit, but that didn't fix it.

 

Anyone with CS6 care to try to replicate this one? (I'm on OS X 10.6.8.)

 

Jeff

 
Replies
  • Currently Being Moderated
    May 23, 2012 10:02 PM   in reply to absqua

    For inserting the contents can you try something like this,

     

     

    frame.insertionPoints[-1].contents = frame.contents;

     

     

    I don't think it will solve your problem, but anyway give a blind guess/try and see what will happen.

     

    Edit: I don't have CS6 to test it...

     

    -------------

    Green4ever

     
    |
    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