Copy link to clipboard
Copied
I want to apply Master Pages to a single document, using the StructMasterPageMaps table on that document's reference pages.
I see the ApplyMasterPage method for a single page, but the only way I've found to use the page map is as part of a book update.
My current workaround is to create a new book, add the file to that book, update the book with only the UpdateBookMasterPages parameter set to True, then close the book without saving it. This works well enough, but it just seems so hacky.
Did I overlook something? Is there a better way to do this?
Copy link to clipboard
Copied
Oliver,
To apply the master page mapping table to a single document, use Format > Page Layout > Apply Master Pages.
--Lynne
Copy link to clipboard
Copied
Sorry, Lynne--
I should have been more clear in my post. I am trying to accomplish this via ExtendScript.
Oliver
Copy link to clipboard
Copied
Oliver,
there is an internal command ApplyMasterPages and in one report I find the FCode to be listed as 21040624 (decimal). But, as this feature is added to FrameMaker via an FDK client (fminit\Plugins\masterpages.dll), I guess the FCode values are assigned dynamically and may be different each time. I guess you could parse the menu command structure to find the command and read the FCode from it… ugly, I know!
The FDK documents (fdkref.pdf) contain a segment about calling clients shipped with FrameMaker, but at least the version I am looking at does not explain the masterpages.dll.
Maybe this helps a little bit,
- Michael
Copy link to clipboard
Copied
Thank you, Michael. Your post provided the key I was looking for:
Fcodes([app.GetNamedCommand("ApplyMasterPages").Fcode])