Skip to main content
Inspiring
July 19, 2020
Answered

How we get caches folder using Extendscript

  • July 19, 2020
  • 2 replies
  • 976 views

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.

This topic has been closed for replies.
Correct answer Laubender

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 )

2 replies

LaubenderCommunity ExpertCorrect answer
Community Expert
July 22, 2020

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 )

AD4003Author
Inspiring
July 22, 2020

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

Kasyan Servetsky
Legend
July 21, 2020

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);
}
AD4003Author
Inspiring
July 22, 2020

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