you can contact me on priv - zapraszam na priv
It turns out that he was not able to help me.
Does anyone else have an idea?
Any thoughts from anyone, please?
OK. I don't know how to do this in VBS and it's been a long time since I have programmed in Visual Basic so here is what I want to do in pseudocode.
ModelNumber = CurrentSelection
For MyCounter = 1 to NumberofHyperlinks 'or number of text frames
Set CurrentItem to ListofItems(MyCounter)
If CurrentItem.Hyperlink = TRUE then
If exist TextAnchor = ModelNumber + CurrentItem.Name(3) then
CurrentItem.HyperlinkDestination = ModelNumber + CurrentItem.Name(3)
So basically I will highlight the model number on the first page and it will pick that up. It will then cycle through all the hyperlinks in the document, or all the text frames if that's easier, and set the destination to an anchor with a name = ModelNumber + First 3 letters in the hyperlink's name. If there is no Hyperlink, it will just skip it. If there is no anchor with the proper name, it will also skip it.
It would only need to process items on the current page and I would change the page manually before running it again.
Sorry, Shaun, but it's still not entirely clear what should happen and when ...
Can you post a screen shot of what the document looks like now? A simple snippet of a relevant portion ought to be enough.
var array = new Array; for (a=0; a<app.activeDocument.hyperlinks.length; a++) array.push(app.activeDocument.hyperlinks[a].name+" -> "+app.activeDocument.hyperlinks[a].source.sourceText.contents); alert (array.join('\n'));
(if the list is so long it appears only partly, just press "Enter").
Hyperlinks consist of two parts: a hyperlink source -- the actual text that gets the link, and may be visible with an outline rectangle, and a hyperlink destination -- an invisible marker with a name. So far, I understand the hyperlinks are already in place but they point to the wrong anchors -- correct?
Yes, that is correct. These files were originally created in Pagemaker 7, but when converted to InDesign the destinations for all of the hyperlinks were messed up. They now all point to the same place. If I delete the destinations, recreate them, and point the source to the new destination it works again. The problem is that I have about 13,000 hyperlinks spread across about 90 files. A large task.
I'm not sure what to take a screenshot of but here is a description. The first two pages consist of pictures of parts. Each picture has a text box containing the 3 digit part number (ie 253, 537, etc). This text box is the source for a hyperlink which has the same name as the 3 digit number, plus -1, -2 etc if there are more than one of the same number. The destination is a number in a long list that is spread through several threaded text frames. The name of the destination is the model number (like 45) plus the 3 digit part number (like 853). So the name would be 45853.
I can create the destinations by hand pretty easily but the linking is tedious. Do you understand now? Any more questions?
Error Number: 55
Error String: Object does not support the property or method 'sourcetext'
Source: array.push(app.activeDocument.hyperlinks[a].name+" -> "+app.activeDocument.hyperlinks[a].source.sourceText.contents);
I tried it on a file where I fixed the links and is still doesn't work. It may be due to the fact that you are using URL destinations and I am using Text Anchors within the same document.
I just want the script to go through the list of hyperlink sources and point them to the proper destinations, text anchors with easy to figure out names.
Also, Robin said he knew how to do it and offered to write me a script for it, but then he got too busy with work, so I came back here.
Hmm. Like Robin, I have no idea how to attack this one.
I've never said that I can't do this or I don't know how to do this
I only don't have time to make this for free ...
There is a mess with Hyperlinks in his files - all of them should be deleted and created again - easiest way . Each TF from first page have numerc contents which could be used to build Source and Destionation (on other pages - in text) of Hyperlink.
Well, anyone else want to take a shot at it?