Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Tim said: "…The parentPage property is set to the left page by default."
Hi Tim,
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:
[1] Usually the center of an object dictates the value of parentPage when an object is crossing the spine.
[2] 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.
[3] 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.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
"Any objects that do not cross the spine, and are deleted, shouldnt affect the final result."
Hm, as I said in [3] this approach could be problematic.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Finally got this working:
Disabled pageshuffle on spread
duplicate the spread
unlock all layers and all objects
cut everything on layer
Delete right page of first spread
paste in place
delete left page of new spread
paste in place
performa a pasteboard clean-up on each page of the spread
script was actually written for a client so can't share entire script but this is the process I adopted and it works properly.
Thanks for your input.
Copy link to clipboard
Copied
Hi Tim,
very good!
Hope, you never come accross a document where stories are threaded from page to page and spread to spread.
Regards,
Uwe Laubender
( ACP )