Pre- and Post-publish notifications not triggered from ExtendScript
I am having a problem with FrameMaker 2020 and notifications in ExtendScript. If I have this code in my startup folder:
Notification (Constants.FA_Note_PrePublishDitamap, true);
Notification (Constants.FA_Note_PostPublishDitamap, true);
function Notify (note, object, sparam, iparam) {
switch (note) {
case Constants.FA_Note_PrePublishDitamap:
alert ("1. In FA_Note_PrePublishDitamap event.");
break;
case Constants.FA_Note_PostPublishDitamap:
alert ("2. In FA_Note_PostPublishDitamap event.");
break;
}
}
I save a ditamap as a FrameMaker book with components, both events are triggered and I see the alerts. However, when I save the ditamap from ExtendScript, the events are not triggered. This is the code I am using to save the ditamap:
function saveMapAsFmBook (map, ditaval) {
var params, returnParams, i, saveName, book;
saveName = map.Name.replace (/\.[^\.]+$/, ".book");
params = GetSaveDefaultParams ();
returnParams = new PropVals ();
i = GetPropIndex (params, Constants.FS_FileType);
params[i].propVal.ival = Constants.FV_SaveFmtBookWithFm;
i = GetPropIndex (params, Constants.FS_AutoBackupOnSave);
params[i].propVal.ival = Constants.FV_SaveNoAutoBackup;
i = GetPropIndex (params, Constants.FS_FileIsInUse);
params[i].propVal.ival = Constants.FV_ResetLockAndContinue;
i = GetPropIndex (params, Constants.FS_ShowProgressBar);
params[i].propVal.ival = Constants.FV_DoYes;
i = GetPropIndex (params, Constants.FS_DontNotifyAPIClients);
params[i].propVal.ival = false;
if (ditaval) {
i = GetPropIndex (params, Constants.FS_DitavalFile);
params[i].propVal.sval = ditaval;
}
book = map.Save (saveName, params, returnParams);
if ((book) && (book.Name)) {
return book;
}
}
Should the notifications get triggered when the save is called from a script?

