Article View: adobe.scripting.indesign
Article #1871Re: Relink does not seem to work
From: Shoji_Masuzawa
Date: Wed, 21 Jan 2009 02:21
Date: Wed, 21 Jan 2009 02:21
27 lines
2389 bytes
2389 bytes
To loic, We, Visual Basic programmers, are pretty sloppy about the cases. Sorry for the confusion. To Eric and Ole, I should have given a full explanation of what I am doing. I created an InDesign document with some 50 images linked to it. All the images are jpg files stored in one folder. Then, I replaced all the image files with the blank image files of the same name. I am using this as a template. Furthermore, I deleted the folder of blank image files so that the links are no longer valid. Now, I get a different set of the image files, all having the same name and size. However, most of these sets are not complete: there are many missing images. What I am trying by script as well as by VB is to check if each image file exists, and then to relink the image frames to the new image files if they exist and to delete the image frames (and pages) which do not have the corresponding image files. All this works beautifully...almost. One problem is that after the script is executed, I open the document and encounter the "Fix Links Automatically" window. Yes, I choose this option and it does fix everything and I get the desired result. But I wonder why InDesign has to fix the links I thought I have established by script. As Ole figured correctly, they have the old links. But doesn't Relink re-establish the link with the new image file? I tried, as Eric suggested, myDocument.Pages(x).AllGraphics(y).ItemLink.Unlink myDocument.Pages(x).AllGraphics(y).ItemLink.Relink "c:\...\myPicture.jpg" myDocument.Pages(x).AllGraphics(y).ItemLink.Update without any success. I am not sure of what effect it has, but I tried the iteration in reverse order as Ole suggested. It didn't help, either. I would be grateful for any further comments. Thank you.
Technical Details
Message-ID:
<59b78c82.8@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newshub.sdsu.edu!webcrossingReferences:
<59b78c82.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,d91c4464ed1af2e4 X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Shoji_Masuzawa@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: Relink does not seem to work Message-ID: <59b78c82.8@webcrossing.la2eafNXanI> Date: Tue, 20 Jan 2009 18:21:36 -0800 References: <59b78c82.-1@webcrossing.la2eafNXanI> Lines: 44 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit