How can I get the file path from the selected object in Adobe Indesign?
Edit: I'm using InDesign CS5 (7.0) Object Model
My user should be able to select an object in Indesign (i.e. a linked file object) and then call a script upon it that edits and saves the linked file. (We have hundresds of .ai files linked that are created by buggy software and need to replace wrongly embedded fonts in some of the .ai files.)
I tried things like
var myObj = app.selection[0];
myFilePath = myObj.filePath;
or
myFilePath = myObj.itemLink.assetURL;
and that did not work. How can I get, in terms of object hierarchy, from the current selection to the string that is the filepath. Selection > Story > Link > Path-property?
Thank you in advance! Kind regards, Stefan