Highlighted

get CEP folder path in jsx code.

Explorer ,
Oct 09, 2020

Copy link to clipboard

Copied

Hi, 

I wanted to know how we can get CEP extension folder path in jsx code.

Thanks

Correct answer by Greg5F9B | Community Beginner

Can't seem to edit my post, nothing loads when I click more.

 

Any way I missed a ) at the end 

 

var csInterface = new CSInterface(); 
locatoin = csInterface.getSystemPath(SystemPath.EXTENSION);
TOPICS
Scripting

Views

76

Likes

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

get CEP folder path in jsx code.

Explorer ,
Oct 09, 2020

Copy link to clipboard

Copied

Hi, 

I wanted to know how we can get CEP extension folder path in jsx code.

Thanks

Correct answer by Greg5F9B | Community Beginner

Can't seem to edit my post, nothing loads when I click more.

 

Any way I missed a ) at the end 

 

var csInterface = new CSInterface(); 
locatoin = csInterface.getSystemPath(SystemPath.EXTENSION);
TOPICS
Scripting

Views

77

Likes

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
Oct 09, 2020 0
Community Beginner ,
Oct 10, 2020

Copy link to clipboard

Copied

You can either pass the location from your JS to your JSX, getting the location using:

var csInterface = new CSInterface(); 
locatoin = csInterface.getSystemPath(SystemPath.EXTENSION;


Or you can get the folder location of the JSX file and use .parent to go back to the root folder.

var folder = File($.fileName).parent.toString(); //This will get the folder your jsx is in add more .parent if you want to go further back
var file = File(folder + "/testFile.json");
app.open(file);

 

Likes

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
Reply
Loading...
Oct 10, 2020 0
Community Beginner ,
Oct 10, 2020

Copy link to clipboard

Copied

Can't seem to edit my post, nothing loads when I click more.

 

Any way I missed a ) at the end 

 

var csInterface = new CSInterface(); 
locatoin = csInterface.getSystemPath(SystemPath.EXTENSION);

Likes

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
Reply
Loading...
Oct 10, 2020 1
Greg5F9B LATEST
Community Beginner ,
Oct 10, 2020

Copy link to clipboard

Copied

Damn not being able to edit is a pain. 

 

You can also ignore the line

app.open(file)

 I copy and pasted from another time I needed the snippet.

Likes

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
Reply
Loading...
Oct 10, 2020 1