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.
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 )
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);
}
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
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 )
Copy link to clipboard
Copied
Thank you very much Laubender. I got the path using this code.