inDesign CS3 text overflows

Can anyone assist me. I am working with a text frame at the bottom of page, I’ve resized the frame to fit on the page but now there is overflow.
What I would like to do is get the content of the overlowed text and put it in a new text frame.
I have searched for how to do this but couldn’t find anything specific.
Can anyone help me with the concept and a snippet?
Thank you.

The easiest way to do this would be to create a new text frame that is linked to the last in the text flow. For that all you need to do is set the previous text frame property when creating the new text frame:

tell application "Adobe InDesign CS3"
	set theTextframe to selection
	if (count of theTextframe) = 1 then
		tell document 1
			set theTextframe to item 1 of theTextframe
			set overflowTextframe to make text frame with properties {geometric bounds:{32, 3.0, 49.0, 31}, previous text frame:theTextframe}
		end tell
	else
		if (count of theTextframe) = 0 then
			display dialog "A text frame must be selected for this script to work."
		else
			display dialog "Only one text frame can be selected for this script to work."
		end if
	end if
end tell

The above shows you how to do this, but does not address the page you are working on so you would need to add that in based on your needs.

If you did not want the text frames linked you could do something like this:

tell application "Adobe InDesign CS3"
	set theTextframe to selection
	if (count of theTextframe) = 1 then
		tell document 1
			set theTextframe to item 1 of theTextframe
			set x to index of last character of theTextframe
			set y to index of last character of parent story of theTextframe
		end tell
		set selection to (text from character (x + 1) to character y) of parent story of theTextframe
		cut
		set selection to insertion point 1 of story 2 of document 1
		paste
	else
		if (count of theTextframe) = 0 then
			display dialog "A text frame must be selected for this script to work."
		else
			display dialog "Only one text frame can be selected for this script to work."
		end if
	end if
end tell

Note, I am using the cut and paste commands to ensure that local styling and inline items are left intact. I could just copy the contents from the story into a variable in AppleScript but this would remove any indesign styling of the text and any inline items.

Jerome,
Thanks for pointing me in the right direction. Worked perfectly… For my purposes the linked text frame was what I was looking for, but thanks for both examples. :smiley: