Writing JXA automation script that executes function of application.
var app = Application('Pages')
var doc = app.open(new Path('path to file'))
app.export(doc, {
to: new Path('path to file'),
as: dstFormat,
withParameters: params
})
app.export function sometimes trows error message box. When that message box is thrown script execution stops. How automatically close that message box?