Copy link to clipboard
Copied
Dear All,
Actually, I created the Menu based IDJS script. we required to exit after some process completion. In this case I tried to use "exit(0)". This not supporting in IDJS script, and showing the "Reference Error".
//========================================
let myInDesign = require("indesign");
let app = myInDesign.app;
const script = require("uxp").script;
const shell = require("uxp").shell;
try
{
main();
//__Process_CallingHTMLPage();
// __CallingUI();
}
catch (error)
{
alert(error);
}
function main()
{
alert("welcome");
exit(0);
}
//==============================//
Can any one help me on this to do to Exit function for above process with in IDJS script.
Kindly do the needful and will appriciate.
Thanks & Regards,
Harihara Sudhan T R.,
Copy link to clipboard
Copied
Can't you just condition your script execution?
function routine1(){…}
function routine2(){…}
function main(){
routine1();
if(condition) return;
routine2();
}
Never had to use exit() in more than 16 years of scripting
Copy link to clipboard
Copied
try return
if in sync function or resolve or reject the promise if in async function
Copy link to clipboard
Copied
Dear sujai,
Thank you, and sure we will check this in IDJS.
Thanks & Regards
Harihara Sudhan T R.,
Find more inspiration, events, and resources on the new Adobe Community
Explore Now