Skip to main content
Community Expert
Jun 9, 2026 12:02 PM UTC
Answered

Issue with getFiles method

Hi All,

I am on macOS 26.5.1 and testing on InDesign 2025. I notice that getFiles function is behaving strangely. If I do something like the following, I get 0

Folder("/Users/manan/Documents").getFiles("").length

The same happens with other folders in this folder as well. Now, my script tries to use unPackageUCF and that too fails with these paths as input. I have noticed one thing, when the folders are created on the same day the code works fine. However, once the folders are older than a day the API starts failing. It does not make any sense to me. Any insights?

Manan JoshiCorrect answer
Community Expert
Jun 10, 2026 2:07 PM UTC

Figured this out. This is due to “Full Disk Access” setting. This was not enabled for InDesign and hence this strange behaviour of the API

-Manan

4 replies

Manan JoshiCommunity ExpertAuthorCorrect answer
Community Expert
Jun 10, 2026 2:07 PM UTC

Figured this out. This is due to “Full Disk Access” setting. This was not enabled for InDesign and hence this strange behaviour of the API

Translate
-Manan
m1b
Community Expert
Community Expert
Jun 28, 2026 9:47 AM UTC

This is good to know ​@Manan Joshi. Were you able to perform a definitive test and, if failed, show the user an alert that they need to give Indesign full disk access?

– Mark

Translate
Peter Kahrel
Community Expert
Community Expert
Jun 9, 2026 12:25 PM UTC

Makes no sense to me either.

All I can say is that getFiles(‘’).length works fine on Windows.

Translate
Community Expert
Jun 9, 2026 12:30 PM UTC

More strangeness. Since this script is a part of CEP extension I tried using cep.fs.deleteFile. This also fails for such files which were created a day ago inside the folder which is a child of Documents folder. The error is 6 which seems to say “File could not be written”.

Seems like a MAC thing now. I recently updated to macOS Tahoe

Translate
-Manan