• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

How we get caches folder using Extendscript

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

TOPICS
Scripting

Views

592

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
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 22, 2020 Jul 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 )

Votes

Translate

Translate
Guru ,
Jul 21, 2020 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);
}

Votes

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
community guidelines
Participant ,
Jul 22, 2020 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

 

Votes

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
community guidelines
Community Expert ,
Jul 22, 2020 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 )

Votes

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
community guidelines
Participant ,
Jul 22, 2020 Jul 22, 2020

Copy link to clipboard

Copied

LATEST

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

Votes

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
community guidelines