I am trying to write a script that splits an indesign spread into two separate pages. I turned off shuffling for page and spread, duplicated the spreead, and tried to delete the right page on the first spread (to be left with just the right) and the left page on the second spread, to be left with just the right. If there is an object that crosses the spine it gets deleted in the second instance. The parentPage property is set to the left page by default. Can this parent be changed, programatically, so that it is seen as belonging to the right page and therefore not lost?
I don’t think so, the page item’s parentPage is read only.
The same problem happens if you try to split a spread’s pages via the UI, so if I’m understanding what you are trying to do, you’ll need to duplicate the crossover item and set the bounds to the two pages.
Here I copied the crossover, Paste in Place, and adjustment of the parent frames’ bounds
Thought of a work-around:
duplicate spread and delete right page of first spread
store current pasteboard dimensions
change current pasteboard top margin to 1.25 * page height
move all objects in spread up by 1.25 * page height
delete left page
move all objects in spread back down by 1.25 * page height
Did this manually and deleting left page no longer deleted the cross spine object.
Will post the script snippet if I can get it working.
Moving the objects instead of copy pasting them should avoid problems arising from changes in stacking order.
As a refinement I will probably later add a routine to move only objects that cross the spine so un-needed objects do not continue to live on the pasteboard.
Not sure I fully understand the problem yet (no coffee) but I think I would just create a new document with facing pages off and duplicate the parentPage to the new doc in order, and figure how to handle items that cross the spine.
Tim said: "…The parentPage property is set to the left page by default."
I don't think so. The value for parentPage is read-only and depends on some factors if you deal with facing pages documents. ( If the object is on the pasteboard the value is null. )
However, you could change the value of parentPage if you move an object.
Some empiric result from all my tests:
 Usually the center of an object dictates the value of parentPage when an object is crossing the spine.
 If the center of an object is exactly positioned on the spine: You may see rounding problems, so it could be left or right from the spine. If it is exactly positioned on the spine, then the page left from the spine is the winner.
 The value of parentPage can return a page object even if its parent object, e.g. a text frame where the object is anchored to, is positioned on the pasteboard.
( ACP )
Do you think it would work if I moved every item over to the right by the width of the page, delete the left page, and move everything back? Any objects that do not cross the spine, and are deleted, shouldnt affect the final result. Am I on the right track?
"Any objects that do not cross the spine, and are deleted, shouldnt affect the final result."
Hm, as I said in  this approach could be problematic.
( ACP )