Skip to main content
Inspiring
Jul 31, 2025 5:55 AM UTC
Answered

How to get activeDocument file path in InDesign UXP?

Hi,
I'm building a UXP plugin for Adobe InDesign. I want to get the full file path of the currently open document.

 

I tried this:
const doc = app.activeDocument;
const filePath = await doc.fullName;  // fullName returns a Promise

 

But I get this error:

Error: Could not find an entry of 'file:///path'
at l._getEntryImpl (uxp://uxp-internal/webfs_scripts.js:2)
Even when the document is saved, it still fails.

 

How can I get the file path of the active document in InDesign using UXP?
Is there any working method
Thanks!

ashwin_0502Correct answer
Inspiring
Aug 1, 2025 12:04 PM UTC

Hello Lisa,
Thank you for your response.
Just to clarify — in UXP for InDesign, doc.fullName returns a Promise. So to retrieve the file path correctly, it’s important to use await first. Once the Promise resolves, you can then access the path using .nativePath.

const doc = app.activeDocument;

const filePath = await doc.fullName; // fullName returns a Promise
console.log("filePath:", filePath);

const filePathVal = filePath.nativePath; // Get the string path
console.log("filePath:", filePathVal);

This approach successfully retrieves the file path once the document is saved.

Thank you!

Best regards,
Ashwin Lohiya

4 replies

Participant
Aug 1, 2025 10:29 AM UTC

Hello,

 

In UXP for InDesign, use: const doc = app.activeDocument;
const filePath = doc.fullName?.fsPath;
Works only if the document is saved.
doc.fullName is not a FileSystemEntry in UXP, so use fsPath to get the string path.

 

Best Regard,

lisa

Translate
ashwin_0502AuthorCorrect answer
Inspiring
Aug 1, 2025 12:04 PM UTC

Hello Lisa,
Thank you for your response.
Just to clarify — in UXP for InDesign, doc.fullName returns a Promise. So to retrieve the file path correctly, it’s important to use await first. Once the Promise resolves, you can then access the path using .nativePath.

const doc = app.activeDocument;

const filePath = await doc.fullName; // fullName returns a Promise
console.log("filePath:", filePath);

const filePathVal = filePath.nativePath; // Get the string path
console.log("filePath:", filePathVal);

This approach successfully retrieves the file path once the document is saved.

Thank you!

Best regards,
Ashwin Lohiya

Translate
leo.r
Community Expert
Community Expert
Jul 31, 2025 8:38 PM UTC

you may also want to post UXP-related questions here:

https://forums.creativeclouddeveloper.com/c/indesign/72

Translate
Inspiring
Aug 1, 2025 4:55 AM UTC

Thank you leo.r sir.,

I’ll keep that in mind for next time. The issue has been resolved now.

Translate