Update: the celebration has started too early. This notification script works very inconsistently in FM19. Although I transfered the script into Autorun, I actually need to select it to and hit Run to make it work. In addition, it saves FM15 files as FM13 only if they are opened as standalone files and not from the book. Here is my updated code. Any input is appreciated! I get no error - just "Result: undefined". #target framemaker
Notification (Constants.FA_Note_PostSaveDoc, Constants.FA_Note_PostSaveBook, true);
var oDoc = app.ActiveDoc;
var oBook = app.ActiveBook;
function Notify (note, object, sparam, iparam) {
switch (note) {
case Constants.FA_Note_PostSaveDoc :
SaveToFM13(oDoc);
break;
case Constants.FA_Note_PostSaveBook :
SaveToFM13(oBook);
break;
}
}
function SaveToFM13(file)
{
if(file.ObjectValid())
{
var params = GetSaveDefaultParams();
var returnParamsp = new PropVals();
var i;
i = GetPropIndex(params, Constants.FS_FileType);
params[i].propVal.ival = Constants.FV_SaveFmtBinary130;
i = GetPropIndex(params, Constants.FS_SaveAsModeName);
params[i].propVal.ival = Constants.FV_SaveAsNameProvided;
i = GetPropIndex (params, Constants.FS_SaveMode);
params[i].propVal.ival = Constants.FV_ModeSaveAs;
file.Save(file.Name, params, returnParamsp);
return;
}
}
... View more