copyObjects() from master page with pasteObjects() to normal page fails

Previous topic - Next topic


I am using copyObjects from a master page, then closeMasterPage(), then pasteObjects() on the current active page.  However, the paste seems to attempt to put the object back on the master page as the currentPage() function returns the page number of the master page - even though it was closed.

I confirmed this by checking currentPage() after closeMasterPage()
which was correctly set back to the page before editMasterPage(x) and then immediately after pasteObjects() the page number changes back to what the page number was when in editMasterPage().

Am I missing something to set before the Paste?

This does work as expected directly in the UI... I can copy any object from a master page and then manually paste it in any normal page.  This is what I want to script.