Highlighted

Open any Folder Path from InDesign javaScript

Engaged ,
Jun 28, 2020

Copy link to clipboard

Copied

Dear Pros.

 

Is it Possible to Open any Folder Path from InDesign JavaScript? and How to?

 

Thanks in Advance

Best Regards

Mohammad

Adobe Community Professional
Correct answer by Charu Rajput | Adobe Community Professional

Hi,

Try following snippet

var path = "~/Desktop";
var folder = Folder(path);
if(folder.exists)
    folder.execute();

 

Let us know if this works for you.

Topics

Scripting

Views

144

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

Open any Folder Path from InDesign javaScript

Engaged ,
Jun 28, 2020

Copy link to clipboard

Copied

Dear Pros.

 

Is it Possible to Open any Folder Path from InDesign JavaScript? and How to?

 

Thanks in Advance

Best Regards

Mohammad

Adobe Community Professional
Correct answer by Charu Rajput | Adobe Community Professional

Hi,

Try following snippet

var path = "~/Desktop";
var folder = Folder(path);
if(folder.exists)
    folder.execute();

 

Let us know if this works for you.

Topics

Scripting

Views

145

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
Adobe Community Professional ,
Jun 28, 2020

Copy link to clipboard

Copied

Hi,

Try following snippet

var path = "~/Desktop";
var folder = Folder(path);
if(folder.exists)
    folder.execute();

 

Let us know if this works for you.

Best regards

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...
Engaged ,
Jun 28, 2020

Copy link to clipboard

Copied

Thank you very much

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...
Adobe Community Professional ,
Jun 28, 2020

Copy link to clipboard

Copied

Yes Mohammad,

It is possible to open any folder path using InDesign JavaScript.

For Windows user if folder is locked by adminstrative, then code won't be able to open that folder.

Folder can be opened using this code :

var folderPath = "D:/Temporary Folder/SunilTestFolder";

if(Folder(folderPath).exists){

    Folder(folderPath).execute();

}

 

 

Best

Sunil

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...
Engaged ,
Jun 28, 2020

Copy link to clipboard

Copied

Thank you very much sunil

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...
Enthusiast ,
Jun 28, 2020

Copy link to clipboard

Copied

This script to select any folder path:

var myFolder = Folder.selectDialog ("Select a folder");
if(myFolder != null){
if(myFolder instanceof Folder){
alert("fsName: " + myFolder.fsName);
alert("fullName: " + myFolder.fullName);
alert("name: " + myFolder.name);
}
}

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...
medos20 LATEST
Engaged ,
Jun 28, 2020

Copy link to clipboard

Copied

Thank you a lot

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