Highlighted

How we get caches folder using Extendscript

Participant ,
Jul 19, 2020

Copy link to clipboard

Copied

Hi Everyone,

 

Today, I am stuck to getting cache folder for both mac and windows. 

How we can get the below paths using javascript?

for Mac: /Users/<user>/Library/Caches/

for Windows: C:\Users\<user>\AppData\Local\

 

Please give any helps.

Thanks.

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

Hi John,

the code below should work:

app.generalPreferences.temporaryFolder.parent

 

With my German InDesign 2020 on Windows 10 it returns:

// ~/AppData/Local/Adobe/InDesign/Version%2015.0/de_DE/Caches

 

Regards,
Uwe Laubender

( ACP )

TOPICS
Scripting

Views

101

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

How we get caches folder using Extendscript

Participant ,
Jul 19, 2020

Copy link to clipboard

Copied

Hi Everyone,

 

Today, I am stuck to getting cache folder for both mac and windows. 

How we can get the below paths using javascript?

for Mac: /Users/<user>/Library/Caches/

for Windows: C:\Users\<user>\AppData\Local\

 

Please give any helps.

Thanks.

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

Hi John,

the code below should work:

app.generalPreferences.temporaryFolder.parent

 

With my German InDesign 2020 on Windows 10 it returns:

// ~/AppData/Local/Adobe/InDesign/Version%2015.0/de_DE/Caches

 

Regards,
Uwe Laubender

( ACP )

TOPICS
Scripting

Views

102

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
Jul 19, 2020 1
Guru ,
Jul 21, 2020

Copy link to clipboard

Copied

JS Folder object has a few properties representing system locations like user's desktop, documents folder, etc.

Maybe you can start from userData to get to the caches folder?

For example, Folder.userData returns ~/AppData/Roaming on my Windows 10 computer.

So I can get it like so:

main();

function main() {
	var userDataFolder = Folder.userData;
	var cacheFolderPath = userDataFolder.parent.absoluteURI + "/Local/cache/"
	var cacheFolder = Folder(cacheFolderPath);
}

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...
Jul 21, 2020 0
Participant ,
Jul 22, 2020

Copy link to clipboard

Copied

Thank you Kasyan_Servetsky.I appreciate your effort.

The above code This will not give the caches folder path. I need to get the InDesign Caches folder path like below.

for Windows: C:\Users\<user>\AppData\Local\Adobe\InDesign\Version 11.0

for Mac: /Users/<user>/Library/Caches/Adobe\ InDesign/Version\ 11.0

 

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...
Jul 22, 2020 0
Adobe Community Professional ,
Jul 22, 2020

Copy link to clipboard

Copied

Hi John,

the code below should work:

app.generalPreferences.temporaryFolder.parent

 

With my German InDesign 2020 on Windows 10 it returns:

// ~/AppData/Local/Adobe/InDesign/Version%2015.0/de_DE/Caches

 

Regards,
Uwe Laubender

( ACP )

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...
Jul 22, 2020 1
Participant ,
Jul 22, 2020

Copy link to clipboard

Copied

Thank you very much Laubender. I got the path using this code.

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...
Jul 22, 2020 0