Hi, while attempting to make this script https://www.scriptopedia.org/en/component/phocadownload/file/115-copy-paste-baseline.html backward compatible with InDesign CS5.5 I also tried today some ugly things like that: try { app.doScript( run, ScriptLanguage.JAVASCRIPT , undefined, UndoModes.ENTIRE_SCRIPT, "PX_TEMP" ); } catch (e) { alert (e || errMsg); } function run() { throw new Error(errMsg = "Im an error"); } try { app.doScript( run, ScriptLanguage.JAVASCRIPT , undefined, UndoModes.ENTIRE_SCRIPT, "PX_TEMP" ); } catch (e) { alert (e && e.message ? e.message : errMsg); } function run() { throw new Error(errMsg = "Im an error"); } My excuse being for my part to cancel the whole doScript action after showing temporary to the user the wrong result that he would get with with values out of range: try { app.doScript( run, ScriptLanguage.JAVASCRIPT , undefined, UndoModes.ENTIRE_SCRIPT, "PX_TEMP" ); } catch (e) { alert (e && e.message ? e.message : errMsg); } function run() { //actions that give wrong results if (!confirm ("Look at this mess. Do you want to keep that result anyway?")) { throw new Error(errMsg = "Wise decision."); } alert ("As you wish."); }
... View more