How do I create a new FM document using Extendscript?
How do I create a new document in FrameMaker using Extendscript without prompting the user? I'd like to duplicate the functionality of the user doing "File" -> "New..." -> "New Document", then selecting the "Portrait" button.
I think I either need to figure out how to programatically locate the "Portrait" template file and pass that as the filename, or maybe there is a open parameter I can specify that says to use the Portrait template.
Here is the code I have so far:
var filename = undefined;
var oParams = GetOpenDefaultParams();
var rParams = new PropVals();
oParams[GetPropIndex(oParams, Constants.FS_NewDoc )].propVal.ival = true;
oParams[GetPropIndex(oParams, Constants.FS_ShowBrowser)].propVal.ival = false;
var doc = Open(filename, oParams, rParams);
if (doc.ObjectValid() == false)
PrintPropVals(rParams);
// PropVals
// --------
// prop num = 1 String value =
// prop num = 2 Integer value = 0
// prop num = 3 Unsigned Integer values are:
// 0
// 0
// 8
// 0
// 0
