Copy link to clipboard
Copied
My client is wanting to supply a library of URLs which should link to specific text labels in InDesign, with a script to assign the URL links to the text labels.
Eg. Whenever the script encounters a text label like ‘SA1757’ in InDesign text, it assigns a corresponding URL such as 'www.pharmac.govt.nz/latest/SA1757.pdf’ to it.
The process needs to be driven by a script in order to automate the process as there are quite a few of these text labels.
The end goal is to be able to generate URLs from these text labels automatically in a PDF file.
Would anyone know how to go about achieving this?
I'm guessing my client would supply some kind of data file (xml?) which assigns specific URLs to specific text fields, which I would then need to instruct InDesign how to process.
The process needs to be driven by a script in order to automate the process as there are quite a few of these text labels.
Have you searched for scripts to do what you want?
Do you mean that there are many variable “one off” links in a spreadsheet or database, or that a small/limited list of links is repeated more than once in a long document?
Does the label text stay the same as it originally was with the hyperlink applied, or should the label text be changed to match the hyperlink?
Depending on t
...Copy link to clipboard
Copied
Hi,
I did something that seems to me a little more complicated for a client.
You could contact me in private if no one helps you here! …
Best,
Michel, for FRIdNGE
Copy link to clipboard
Copied
Moved to InDesign Scripting
Copy link to clipboard
Copied
HI,
Yes, if the root part of the URL ('www.pharmac.govt.nz/latest/" changes then you would need some way to point the last portion of the URL to the text (I would suggest a spreadsheet. Unless the document is structured for XML, an xml file would be of no advantage.
S. Hopkins
Copy link to clipboard
Copied
The process needs to be driven by a script in order to automate the process as there are quite a few of these text labels.
Have you searched for scripts to do what you want?
Do you mean that there are many variable “one off” links in a spreadsheet or database, or that a small/limited list of links is repeated more than once in a long document?
Does the label text stay the same as it originally was with the hyperlink applied, or should the label text be changed to match the hyperlink?
Depending on the answers, native features could accomplish this without scripting, however scripting would make this so much easier.
EDIT: After some searching, the following script automates what I was suggesting is possible via native features (find/replace…Convert URL’s to hyperlinks…find/replace):
https://www.rorohiko.com/wordpress/use-indesign-find-and-replace-to-assign-hyperlinks-to-text/
Read the documentation carefully as the script must be configured to work with your required URL’s and links… However if you have a spreadsheet of the label and the matching link, then you would probably want a script that worked with such input.
Copy link to clipboard
Copied
Many thanks for this: it looks bang on the money! I'll forward this to my client and we will hopefully be implementing this in the new year.
Have a great Christmas!!