Skip to main content
Inspiring
July 31, 2025
Answered

How to get activeDocument file path in InDesign UXP?

  • July 31, 2025
  • 2 replies
  • 358 views

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!

Correct answer ashwin_0502

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

2 replies

Participant
August 1, 2025

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

ashwin_0502AuthorCorrect answer
Inspiring
August 1, 2025

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

leo.r
Community Expert
Community Expert
July 31, 2025

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

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

Inspiring
August 1, 2025

Thank you leo.r sir.,

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