Extendscript and FM2020: 2 functions can't be run on PostSaveDoc
Hello fellows,
I hope everybody is healthy and doing well!
I have an event-driven script that is supposed be triggered upon a PostSaveDoc notification (see the code below). What the SaveAsFM13 function does is quite obvious. The SyncFM() function just copies the file to a network folder. The problem is that one function is executed only when the other one is not called. Both of them cannot be executed when saving a file. Why can't these functions coexist and be executed one after another? Thanks for your input in advance!
var doc = app.ActiveDoc;
//Register for notification
Notification(Constants.FA_Note_PostSaveDoc, true);
//Handle notification
function Notify(args, object, sparam, iparam)
{
object.IsOnScreen = 1;
switch (args)
{
case Constants.FA_Note_PostSaveDoc:
SaveAsFM13(object, sparam);
SyncFM(object);
break;
}
}
...
