I have a threaded text frame with two text frames total in the thread. I am trying to move only the second half of the threaded text frame from the second-to-last page to the last page of my document. I have been able to successfully do this using this code:
var myDocument = app.activeDocument;
var myEndFrame = myDocument.pages[myDocument.pages.length-2].textFrames.endTextFrame;
However, this code does not work when the second half of my threaded text frame has another text box grouped inside of it (such as a pull quote). In that case, the script will only move the threaded text frame part and not the other text box grouped with it. I need the two text boxes to remain grouped, and I would like to move the entire group together to the last page of my document. I have tried everything I can think of to get this to work and have been unsuccessful. (For example, I tried to get my code to move the entire group, but I can't get it to recognize the grouped text boxes as a group.) It could be that I'm missing something obvious. Any help would be greatly appreciated.
Suggest to check myEndFrame.parent before move.
If its constructor.name == "Group" redefine myEndFrame. I mean:
//.... myEndFrame = myDocument.pages[-2].textFrames.endTextFrame; if (myEndFrame.parent.constructor.name == "Group") myEndFrame = myEndFrame.parent; myEndFrame.move(myDocument.pages[-1); //...
I'm so glad I asked for help! Thanks so much, Jarek.