Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
6

Exit command not working in IDJS script

Explorer ,
Aug 07, 2023 Aug 07, 2023

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.,

 

 

TOPICS
Scripting , UXP Scripting
430
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Aug 08, 2023 Aug 08, 2023

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 08, 2023 Aug 08, 2023

try return  if in sync function or resolve or reject the promise if in async function

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 09, 2023 Aug 09, 2023
LATEST

Dear sujai,

 

Thank you, and sure we will check this in IDJS. 

 

Thanks & Regards

Harihara Sudhan T R.,

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines