This content has been marked as final. Show 5 replies
It's still oldDocument:
Doesn't that work? I didn't actually realize there was a loadMasters method for documents!
var oldDocName = app.activeDocument.name;
// Create a new document with the correct page size, etc.
var newDocument = app.documents.add();
newDocument.documentPreferences.pageWidth = 7.625;
newDocument.documentPreferences.pageHeight = 10;
// Load masters from old document
newDocument.LoadMasters(oldDocument) doesn't work. I get the error "Invalid value for paramenter 'from' of event 'loadMasters'. Expected File, but received Document". So I guess loadMasters expects a reference to a file name.
The approach suggested by Kasyan works great. Thank you to you both, Dave and Kasyan!
Ah, in that case:
would have done the trick.