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

How to get activeDocument file path in InDesign UXP?

Explorer ,
Jul 30, 2025 Jul 30, 2025

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!

TOPICS
UXP Scripting
467
Translate
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

Explorer , Aug 01, 2025 Aug 01, 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 app

...
Translate
Community Expert ,
Jul 31, 2025 Jul 31, 2025

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

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

Translate
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
Explorer ,
Jul 31, 2025 Jul 31, 2025

Thank you leo.r sir.,

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

Translate
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
New Here ,
Aug 01, 2025 Aug 01, 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

Translate
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
Explorer ,
Aug 01, 2025 Aug 01, 2025
LATEST

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