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

How to get current running file(jsx) path?

Contributor ,
Jun 20, 2016 Jun 20, 2016

Copy link to clipboard

Copied

Hi.

I want to get saved path of current running jsx file.

Is there a way?

Thanks.

TOPICS
Scripting

Views

798
Translate

Report

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

correct answers 1 Correct answer

Contributor , Jun 20, 2016 Jun 20, 2016

Hi, is it ok for you?

it seems `app.activeScript` or `$.fileName` is what you wanted.

#target indesign

try {

  // not active in ESTK

  // return script path if run from ScriptPanel

  alert(app.activeScript);

}

catch(e){

  alert(e);

}

// return bridgetalk if run with double clicking jsx

// return script path if run from ScriptPanel

alert($.fileName);

alert($.includePath);

thank you

mg.

Votes

Translate
Contributor ,
Jun 20, 2016 Jun 20, 2016

Copy link to clipboard

Copied

I solved it myself.

$.includePath

Votes

Translate

Report

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
Contributor ,
Jun 20, 2016 Jun 20, 2016

Copy link to clipboard

Copied

Hi, is it ok for you?

it seems `app.activeScript` or `$.fileName` is what you wanted.

#target indesign

try {

  // not active in ESTK

  // return script path if run from ScriptPanel

  alert(app.activeScript);

}

catch(e){

  alert(e);

}

// return bridgetalk if run with double clicking jsx

// return script path if run from ScriptPanel

alert($.fileName);

alert($.includePath);

thank you

mg.

Votes

Translate

Report

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
Contributor ,
Jun 20, 2016 Jun 20, 2016

Copy link to clipboard

Copied

LATEST

Your answer is a more simple way.

Thank you.

Votes

Translate

Report

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