Skip to main content
orib7317974
Known Participant
April 17, 2023
Question

Does an InDesign script have access to the name/path of an open IDML file?

  • April 17, 2023
  • 2 replies
  • 598 views

Hi,

Assuming you've opened an IDML file, so it's now the active document. Does InDesign remember its name and/or path? Can a script access that information?

Thanks!

This topic has been closed for replies.

2 replies

Community Expert
April 17, 2023

Hm.

You'll get the path of course if you open the IDML file by scripting.

Or if you intercept the user's intention to open a document through an event script that is hooked to the File Open dialog…

( Just an idea… )

 

Regards,
Uwe Laubender
( Adobe Community Expert )

orib7317974
Known Participant
April 17, 2023

That interception is an interesting idea. What if the user simply double clicks the file in Finder / File Explorer? Is there a way to intercept a file opened this way?

 

Either way, do you have a sample script I could refer to in order to learn how to do that? So far I've only written scripts you need to manually run from the scripts panel.

Community Expert
April 18, 2023

@orib7317974 said: "What if the user simply double clicks the file in Finder / File Explorer?"

 

Hm. I think, that this case is not covered with the File > Open… menu.

Did some tests with some code, but I'm still not satisfied with the results.

 

Regards,
Uwe Laubender
( Adobe Community Expert )

Community Expert
April 17, 2023

Name you can get using the name property of the document like below

app.documents[0].name

Path I think we won't be able to get.

-Manan

-Manan