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

Get filepath of linked object

Community Beginner ,
Aug 10, 2017 Aug 10, 2017

Copy link to clipboard

Copied

How can I get the file path from the selected object in Adobe Indesign? (InDesign CS5 (7.0) Object Model)

I need the Path property from the Link Info in a string variable so I can open the linked file for editing.

ind_file_path.PNG

I tried some things, none of them worked:

     var myObj = app.selection[0];
     myFilePath
= myObj.filePath;
or
     myFilePath
= myObj.itemLink.assetURL;

then somebody suggested (also not working)

          myFilePath = myObj.itemLink.filePath;

Thank you very much for your help!

Kind regards,

Stefan

TOPICS
Scripting

Views

1.6K

Translate

Translate

Report

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

Community Expert , Aug 10, 2017 Aug 10, 2017

Hi Stefan,

what exactly is selected in your tests?
The container frame holding the image or the image itself?

If you selected the graphic frame holding the image you'll get the path this way:

app.selection[0].graphics[0].itemLink.filePath;

Regards,
Uwe

Votes

Translate

Translate
Community Expert ,
Aug 10, 2017 Aug 10, 2017

Copy link to clipboard

Copied

Hi Stefan,

what exactly is selected in your tests?
The container frame holding the image or the image itself?

If you selected the graphic frame holding the image you'll get the path this way:

app.selection[0].graphics[0].itemLink.filePath;

Regards,
Uwe

Votes

Translate

Translate

Report

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
Community Beginner ,
Aug 23, 2017 Aug 23, 2017

Copy link to clipboard

Copied

Dear Uwe, thanks a heap. This is exactely what I was looking for and it works. Where would you look that up if you didn't already know it? I checked the manual at Adobe InDesign CS5 (7.0) Object Model JS: Table of Contents but even now when I know the answer I am not able to "trace" your answer in the manual. Thanks again.

Votes

Translate

Translate

Report

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
Community Expert ,
Aug 23, 2017 Aug 23, 2017

Copy link to clipboard

Copied

LATEST

Hi Stefan,

a lot of experience that came out of a lot of testing plus some very good resources like this by Jongware:

Indesign JavaScript Help

And: Regular reading, debating and commenting on this forum over the years 🙂

Regards,
Uwe

Votes

Translate

Translate

Report

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