Linked ai files in Indesign
Does anyone know a way of changing an .ai link in Indesign, without having to select the link, relink, select file etc.
Does anyone know a way of changing an .ai link in Indesign, without having to select the link, relink, select file etc.
Hi Leah,
a script could help that would relink with options showing. The original idea is from John Hawkinson. Unfortunately I cannot find the related old thread in the new forum.
But below is my code in ExtendScript (JavaScript) that is working on a selected graphic frame or the selected placed graphic or image itself:
// PlaceAgain-PlaceOptionsShowing-SELECTION.jsx
// Uwe Laubender
//DESCRIPTION:Select a placed image, PDF or InDesign document to replace it with itself getting options
/**
* @@@BUILDINFO@@@ PlaceAgain-PlaceOptionsShowing-SELECTION.jsx !Version! Fri Sep 09 2016 14:09:53 GMT+0200
*/
/*
Posted in this thread at Adobe InDesign Forum:
"Toggle pages of a linked Indesign document inside Indesign?"
mmackinven | Sep 9, 2016
https://forums.adobe.com/message/8993859#8993859
You can either select the placed file directly or its container frame.
Or, if its part of a group, the group itself.
Or, if the container frame is pasted inside another object, that object.
*/
placeAgainSelection();
function placeAgainSelection()
{
if(app.documents.length == 0){alert("ERROR"+"\r"+"No document is open."); return};
if(app.selection.length != 1){alert("ERROR"+"\r"+"Select one single item containing a placed file."); return};
// The placed object is selected:
if
(
app.selection[0].constructor.name == "ImportedPage" ||
app.selection[0].constructor.name == "PDF" ||
app.selection[0].constructor.name == "EPS" ||
app.selection[0].constructor.name == "Image" ||
app.selection[0].constructor.name == "PICT" ||
app.selection[0].constructor.name == "WMF"
)
{
var graphic = app.selection[0];
};
else if(app.selection[0].allGraphics.length == 0){return};
// The container of the placed object is selected:
else{var graphic = app.selection[0].allGraphics[0]};
// Two important checks:
// Case 1: Graphic was pasted on the page from e.g. PhotoShop:
if(graphic.itemLink == null){alert("ERROR"+"\r"+"The graphic was pasted on the page. The original file cannot be found.");return};
// Case 2: Link is not available, because placed graphic was renamed, removed or otherwise is not available:
var file = File(graphic.itemLink.filePath);
if(!file.exists){alert("ERROR"+"\r"+"\""+file.name+"\""+"\r"+"File cannot be found."); return};
// If you cancel the place options dialog, no error will be thrown:
try{
graphic.place(file,true);
}catch(e){};
};
Tested with my German InDesign 2020 on Windows 10 where I placed an AI file from Illustrator 2020 using four artboards. I selected the graphic frame and ran the script. Placing options are showing up immediately and I am able to replace the selected graphic with itself using a different artboard:

Regards,
Uwe Laubender
( ACP )
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.