I am trying to add a folder to an empty book, which I have as the ActiveBook. This does not work:
#target framemaker var book = app.ActiveBook; var folder = book.NewBookComponentOfTypeInHierarchy ("Widget Guide", Constants.FV_BK_FOLDER);
Anyone else been able to add a folder to a book? There is an FDK 11 sample showing how to do it with the FDK, but I can't find any ExtendScript examples.
If there are any Adobe engineers reading this, please help! I am trying to help a paying customer (Microsoft) that wants to switch to FrameMaker. Thanks.
OK, further information about this: apparently NewBookComponentOfTypeInHierarchy only works with structured books. So I am able to do this:
#target framemaker var book = app.ActiveBook; var elemLoc = new ElementLoc (book.HighestLevelElement, null, 0); var folder = book.NewBookComponentOfTypeInHierarchy ("Widget Guide", Constants.FV_BK_FOLDER, elemLoc);
However, you can add a folder to an unstructured book with the interface, so I am not sure why there is not a programatic way to do it with unstructured books. BTW, I found this information in the FrameScript documentation!