Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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 )
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
@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 )
Copy link to clipboard
Copied
I appreciate you did those tests for me, thank you very much!