• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Getting a script to search and save URL tags to text fields

Community Beginner ,
Dec 03, 2018 Dec 03, 2018

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.

TOPICS
Scripting

Views

964

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 08, 2018 Dec 08, 2018

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

...

Votes

Translate

Translate
Guide ,
Dec 03, 2018 Dec 03, 2018

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 06, 2018 Dec 06, 2018

Copy link to clipboard

Copied

Moved to InDesign Scripting

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 08, 2018 Dec 08, 2018

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 08, 2018 Dec 08, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 10, 2018 Dec 10, 2018

Copy link to clipboard

Copied

LATEST

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!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines