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

get file path of executing javascript

Explorer ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

I am executing a javascript file and from within this file I want to execute other files. 

 

I can use $.evalFile(file) if I fully qualify the file to run. i.e. $.evalFile("C:/temp/name.js");  But I want to run the file based on the location of the currently running javascript.  I cannot seem to find a way to get access to the DOM object to determine anything.  I seem to have access to the app object but I cannot find any documentation on this object to determine if it might have a method I can use. 

 

I found app.activeDocument. Do thing the following:

 

docRef = app.activeDocument;

 

So I have access to the document object as well but I still need to find the property on one of these two which will give me the extension path so I do not have to hardcode it into my function. 

TOPICS
Actions and scripting

Views

1.0K

Translate

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

Community Expert , Aug 23, 2020 Aug 23, 2020

Try the following, it shall give the path of the executing script

$.fileName

-Manan

Votes

Translate

Translate
Adobe
Explorer ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

ignore this reply. I have added it into the original post.

Votes

Translate

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
Community Expert ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

LATEST

Try the following, it shall give the path of the executing script

$.fileName

-Manan

Votes

Translate

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