Skip to main content
Inspiring
October 16, 2018
Answered

Import option script

  • October 16, 2018
  • 1 reply
  • 1065 views

Hi there,

I used this very handy script below since a while, but it stopped working since Indesign 13.1

https://indesignsecrets.com/script-show-options-files.php

It is a very simple one-liner javascript, which allows to show the import options of links again. Very useful when exchanging the page of a placed pdf.

var g; (g=app.selection[0].graphics[0]).place(g.itemLink.filePath, true); 

Now the following error appears:

Error Number: 35869

Error String: Cannot create the link resource from the given URI.

My javascript skills are pretty basic and I do not know the Indesign API – I tried to fix it myself, but I couldn't get it to work.

Would very much appreciate if someone could help me with this.

This topic has been closed for replies.
Correct answer julians24124784

Never mind – I found the solution.

It was actually not the script. It was the fact that the links were located on my mac mini and not on my pc.

I was able to fix it (in a very ugly way) like below

try { var g; (g=app.selection[0].graphics[0]).place(g.itemLink.filePath, true); }

catch(err) { var g; (g=app.selection[0].graphics[0]).place(g.itemLink.filePath.replace("Macintosh HD:Users:",""), true); }

Pretty odd to me that "app.selection[0].graphics[0].itemLink.filePath" always starts with "Macintosh HD:Users:" even if it is not located on this disk?

1 reply

julians24124784AuthorCorrect answer
Inspiring
October 16, 2018

Never mind – I found the solution.

It was actually not the script. It was the fact that the links were located on my mac mini and not on my pc.

I was able to fix it (in a very ugly way) like below

try { var g; (g=app.selection[0].graphics[0]).place(g.itemLink.filePath, true); }

catch(err) { var g; (g=app.selection[0].graphics[0]).place(g.itemLink.filePath.replace("Macintosh HD:Users:",""), true); }

Pretty odd to me that "app.selection[0].graphics[0].itemLink.filePath" always starts with "Macintosh HD:Users:" even if it is not located on this disk?