Skip to main content
January 24, 2011
Answered

[CS5][JS] How to remove all content from TextFrame?

  • January 24, 2011
  • 1 reply
  • 395 views

Hello,

I'm wondering what the best way to remove ALL CONTENT (i.e. text, graphics, etc) from a textframe? Previously, I've done it in a loop because of the overflow possibility:

while(textframe.overflow == true){

     textframe.contents = "";

}

This works fine if there is only text in the frame, but if there is a graphic or if some text is horizontal and some is vertical, it becomes an infinite loops because it can't remove the rest of the content.

It seems like there  should be a better way to remove everything from a textframe, does anyone know of a way?

Thanks in advance,

Lloyd

This topic has been closed for replies.
Correct answer Harbs.

Not sure if this is what you want...

textFrame.parentStory.contents = "";

Harbs

1 reply

Harbs.
Harbs.Correct answer
Legend
January 24, 2011

Not sure if this is what you want...

textFrame.parentStory.contents = "";

Harbs

January 24, 2011

Awesome, yes that does seem to work how I need it to. I knew that had to be a simpler way

Thanks!!