🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
10 messages
10 total messages Started by Shoji_Masuzawa Mon, 19 Jan 2009 06:05
Relink does not seem to work
#1809
Author: Shoji_Masuzawa
Date: Mon, 19 Jan 2009 06:05
5 lines
865 bytes
I have the following line in my script:

myDocument.Pages(x).AllGraphics(y).ItemLink.Relink "c:\...\myPicture.jpg"

I intend to relink the picture to the graphic placeholder, but when I open the document after the script is executed, it still prompts with the window of "Fix Links Automatically". What did I do wrong? Thank you.
Re: Relink does not seem to work
#1816
Author: Peter Kahrel
Date: Mon, 19 Jan 2009 09:58
3 lines
714 bytes
I wouldn't have thought that "c:\...\myPicture.jpg" is a legal path name on a PC. What do the three dots stand for?

Peter
Re: Relink does not seem to work
#1819
Author: Dave_Saunders
Date: Mon, 19 Jan 2009 12:06
3 lines
662 bytes
After a relink you must always issue an update of the link.

Dave
Re: Relink does not seem to work
#1833
Author: Shoji_Masuzawa
Date: Tue, 20 Jan 2009 02:18
16 lines
1104 bytes
To Peter,

Thanks for your reply. "c:\...\myPicture.jpg" is just an example of a path. In the real script, it has the correct path of a jpg file.

To Dave,

Thank you for pointing it out. Yes, I added the update line:

myDocument.Pages(x).AllGraphics(y).ItemLink.Relink "c:\...\myPicture.jpg"
myDocument.Pages(x).AllGraphics(y).ItemLink.Update

but, it does the same.

When I open the Link window and examine the link, it is correct. Why, then, does that "Fix Links Automatically" window pop up?

Thank you.
Re: Relink does not seem to work
#1839
Author: loic_aigon
Date: Tue, 20 Jan 2009 10:37
5 lines
772 bytes
try update()
what are these capitals all around ?
myDocument.Pages(x).AllGraphics(y).ItemLink.Update
you should have
myDocument.pages(x).allGraphics(y).itemLink.update();
Re: Relink does not seem to work
#1841
Author: Peter Kahrel
Date: Tue, 20 Jan 2009 11:05
10 lines
674 bytes
Loic,

      what are these capitals all around ?




Shoji uses VB.

Peter
Re: Relink does not seem to work
#1845
Author: loic_aigon
Date: Tue, 20 Jan 2009 13:19
2 lines
642 bytes
Very confused so and all apologizes to Shoji then.:-)
Loic
Re: Relink does not seem to work
#1851
Author: Eric
Date: Tue, 20 Jan 2009 16:15
3 lines
1060 bytes
You can also try unlinking the graphic first. Then relink it and update. In CS2 I've had a few instances where files would show one graphic in the ID preview and print a different one. That was the only way to fix it.

The other option is that your document is corrupt. We've also seen rare cases where there would be a link listed that had no associated page number. The only way to get rid of those is to export the document to InDesign Interchange Format and then reimport them.
Re: Relink does not seem to work
#1857
Author: Olav_Kvern
Date: Tue, 20 Jan 2009 18:18
7 lines
886 bytes
Hi Shoji,

I think that the most likely problem is that the reference to the graphic and (therefore) to the link are pointing to the wrong graphic/link. It looks like you're iterating through the graphics, given the use of variables in the Item--have you tried iterating in reverse order?

Thanks,

Ole
Re: Relink does not seem to work
#1871
Author: Shoji_Masuzawa
Date: Wed, 21 Jan 2009 02:21
27 lines
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.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads