Highlighted

CS6 hyperlink problem

Contributor ,
Jun 01, 2012

Copy link to clipboard

Copied

Hi everyone,

 

In Indesign CS6, I created a new URL hyperlink and pasted the following link into the field:

http://law.ato.gov.au/atolaw/view.htm?docid=AID/AID2004688/00001

But when I click OK and then look in the URL field in the hyperlinks panel, I see that Indesign has changed the link to the following:

http://law.ato.gov.au/atolaw/view.htm%3Fdocid%3DAID/AID2004688/00001

Notice how it's swapping out the question mark (?) after .htm with %3F.

It's also swapping out the equals sign (=) with %3D.

This breaks the URL and makes it no longer workable.

I tried reinstalling Indesign but the problem still remains.

I wondered if anyone knows why this is happening and whether there's a workaround?

Appreciate any help.

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

@gwhPoster – That seems to be an encoding problem. Do you use a prerelease beta version of InDesign CS6?

Background:
It seems that every URL that is filled in in the Hyperlink palette is encoded with something like encodeURI() (a global ExtendScript function):

string encodeURI (text: string)

Encodes a string after RFC2396.

Create an UTF-8 ASCII encoded version of this string. The string is converted into UTF-8. Every non-alphanumeric character is encoded as a percent escape character of the form %xx, where xx is the hex value of the character. After the conversion to UTF-8 encoding and escaping, it is guaranteed that the string does not contain characters codes greater than 127. The list of characters not to be encoded is -_.!~*'();/?:@&=+$,#. The method returns false on errors.

To get it back to a working URL we could decode it by "decodeURI()":

string decodeURI (uri: string)

Decodes a string created with encodeURI().

To correct that you could use the following script (JavaScript).

(After running the script don't go to "Hyperlink options…" in the Hyperlink panel and hit "OK" since the URL is converted back and you have to run the script again to correct that!)

JavaScript:

//DecodeURI_AllHyperlinks_DestinationURL_Name.jsx

//DESCRIPTION:Decodes all hyperlink destination URLs and names; can be undone in one go!

//Uwe Laubender

/**

* @@@BUILDINFO@@@ DecodeURI_AllHyperlinks_DestinationURL_Name.jsx !Version! Mon Jun 04 2012 14:48:49 GMT+0200

*/

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;

app.doScript(_DecodeURI_AllHyperlinks_DestinationURL_Name, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT, "Decode all hyperlink URLs and names");

function _DecodeURI_AllHyperlinks_DestinationURL_Name(){

var d = app.documents[0];

var allHyperlinks = d.hyperlinks;

for(var n=0;n<allHyperlinks.length;n++){

    var newDestURL = decodeURI(allHyperlinks.destination.destinationURL);

    var newDestName = decodeURI(allHyperlinks.destination.name);

    allHyperlinks.destination.destinationURL = newDestURL;

    try{

    allHyperlinks.destination.name = newDestName;

    }catch(e){};

    };

}; //END function "_DecodeURI_AllHyperlinks_DestinationURL_Name()"

Hope that helps.

Uwe

Views

57.2K

Likes

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

CS6 hyperlink problem

Contributor ,
Jun 01, 2012

Copy link to clipboard

Copied

Hi everyone,

 

In Indesign CS6, I created a new URL hyperlink and pasted the following link into the field:

http://law.ato.gov.au/atolaw/view.htm?docid=AID/AID2004688/00001

But when I click OK and then look in the URL field in the hyperlinks panel, I see that Indesign has changed the link to the following:

http://law.ato.gov.au/atolaw/view.htm%3Fdocid%3DAID/AID2004688/00001

Notice how it's swapping out the question mark (?) after .htm with %3F.

It's also swapping out the equals sign (=) with %3D.

This breaks the URL and makes it no longer workable.

I tried reinstalling Indesign but the problem still remains.

I wondered if anyone knows why this is happening and whether there's a workaround?

Appreciate any help.

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

@gwhPoster – That seems to be an encoding problem. Do you use a prerelease beta version of InDesign CS6?

Background:
It seems that every URL that is filled in in the Hyperlink palette is encoded with something like encodeURI() (a global ExtendScript function):

string encodeURI (text: string)

Encodes a string after RFC2396.

Create an UTF-8 ASCII encoded version of this string. The string is converted into UTF-8. Every non-alphanumeric character is encoded as a percent escape character of the form %xx, where xx is the hex value of the character. After the conversion to UTF-8 encoding and escaping, it is guaranteed that the string does not contain characters codes greater than 127. The list of characters not to be encoded is -_.!~*'();/?:@&=+$,#. The method returns false on errors.

To get it back to a working URL we could decode it by "decodeURI()":

string decodeURI (uri: string)

Decodes a string created with encodeURI().

To correct that you could use the following script (JavaScript).

(After running the script don't go to "Hyperlink options…" in the Hyperlink panel and hit "OK" since the URL is converted back and you have to run the script again to correct that!)

JavaScript:

//DecodeURI_AllHyperlinks_DestinationURL_Name.jsx

//DESCRIPTION:Decodes all hyperlink destination URLs and names; can be undone in one go!

//Uwe Laubender

/**

* @@@BUILDINFO@@@ DecodeURI_AllHyperlinks_DestinationURL_Name.jsx !Version! Mon Jun 04 2012 14:48:49 GMT+0200

*/

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;

app.doScript(_DecodeURI_AllHyperlinks_DestinationURL_Name, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT, "Decode all hyperlink URLs and names");

function _DecodeURI_AllHyperlinks_DestinationURL_Name(){

var d = app.documents[0];

var allHyperlinks = d.hyperlinks;

for(var n=0;n<allHyperlinks.length;n++){

    var newDestURL = decodeURI(allHyperlinks.destination.destinationURL);

    var newDestName = decodeURI(allHyperlinks.destination.name);

    allHyperlinks.destination.destinationURL = newDestURL;

    try{

    allHyperlinks.destination.name = newDestName;

    }catch(e){};

    };

}; //END function "_DecodeURI_AllHyperlinks_DestinationURL_Name()"

Hope that helps.

Uwe

Views

57.2K

Likes

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
Jun 01, 2012 0
Adobe Community Professional ,
Jun 04, 2012

Copy link to clipboard

Copied

@gwhPoster – That seems to be an encoding problem. Do you use a prerelease beta version of InDesign CS6?

Background:
It seems that every URL that is filled in in the Hyperlink palette is encoded with something like encodeURI() (a global ExtendScript function):

string encodeURI (text: string)

Encodes a string after RFC2396.

Create an UTF-8 ASCII encoded version of this string. The string is converted into UTF-8. Every non-alphanumeric character is encoded as a percent escape character of the form %xx, where xx is the hex value of the character. After the conversion to UTF-8 encoding and escaping, it is guaranteed that the string does not contain characters codes greater than 127. The list of characters not to be encoded is -_.!~*'();/?:@&=+$,#. The method returns false on errors.

To get it back to a working URL we could decode it by "decodeURI()":

string decodeURI (uri: string)

Decodes a string created with encodeURI().

To correct that you could use the following script (JavaScript).

(After running the script don't go to "Hyperlink options…" in the Hyperlink panel and hit "OK" since the URL is converted back and you have to run the script again to correct that!)

JavaScript:

//DecodeURI_AllHyperlinks_DestinationURL_Name.jsx

//DESCRIPTION:Decodes all hyperlink destination URLs and names; can be undone in one go!

//Uwe Laubender

/**

* @@@BUILDINFO@@@ DecodeURI_AllHyperlinks_DestinationURL_Name.jsx !Version! Mon Jun 04 2012 14:48:49 GMT+0200

*/

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;

app.doScript(_DecodeURI_AllHyperlinks_DestinationURL_Name, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT, "Decode all hyperlink URLs and names");

function _DecodeURI_AllHyperlinks_DestinationURL_Name(){

var d = app.documents[0];

var allHyperlinks = d.hyperlinks;

for(var n=0;n<allHyperlinks.length;n++){

    var newDestURL = decodeURI(allHyperlinks.destination.destinationURL);

    var newDestName = decodeURI(allHyperlinks.destination.name);

    allHyperlinks.destination.destinationURL = newDestURL;

    try{

    allHyperlinks.destination.name = newDestName;

    }catch(e){};

    };

}; //END function "_DecodeURI_AllHyperlinks_DestinationURL_Name()"

Hope that helps.

Uwe

Likes

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
Reply
Loading...
Jun 04, 2012 2
Contributor ,
Jun 04, 2012

Copy link to clipboard

Copied

Thanks for the reply,

No it wasn't a pre-release - it's just CS6. I've contacted adobe and they were able to replicate the problem from their end but they haven't fixed the issue as yet. I may need to use your script if they don't provide a solution so thanks for posting it.

Likes

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
Reply
Loading...
Jun 04, 2012 0
Adobe Community Professional ,
Jun 04, 2012

Copy link to clipboard

Copied

@gwhPoster – use the script with care. I did a little testing, but one never knows where it might fail…

Uwe

Likes

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
Reply
Loading...
Jun 04, 2012 0
Adobe Community Professional ,
Jun 05, 2012

Copy link to clipboard

Copied

@gwhPoster – in the meantime I filed a bug report. You should do that, too. The more people the more likely this issue will be fixed in the next round (InDesign 8.0.1).

Did you already test my script snippet?

Does it work for you?

Uwe

Likes

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
Reply
Loading...
Jun 05, 2012 0
Contributor ,
Jun 05, 2012

Copy link to clipboard

Copied

Hi,

No I'm still waiting for Adobe to respond with a solution to the link problem so I haven't used your script as yet. I just plan to wait a few more days to see if they come up with a fix and then I'll decide.

Thanks again for posting it.

Likes

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
Reply
Loading...
Jun 05, 2012 0
LEGEND ,
Jun 05, 2012

Copy link to clipboard

Copied

Stop holding your breath. These things take weeks, or maybe months to fix.

Likes

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
Reply
Loading...
Jun 05, 2012 0
Contributor ,
Jun 05, 2012

Copy link to clipboard

Copied

The guy on the phone said around 48 hours so I thought I'd wait at least until then and give them a call back. But you're probably right though - they may not have it done by then.

Likes

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
Reply
Loading...
Jun 05, 2012 0
LEGEND ,
Jun 05, 2012

Copy link to clipboard

Copied

These froums are littered with posts about soomeone onthe phone promised to call back and never did. Do you have a case number? The names of everyone you talked to?

Likes

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
Reply
Loading...
Jun 05, 2012 0
Contributor ,
Jun 05, 2012

Copy link to clipboard

Copied

Yeah I have a name and a case number so I've got something to go by.

Likes

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
Reply
Loading...
Jun 05, 2012 0
LEGEND ,
Jun 05, 2012

Copy link to clipboard

Copied

Well, good luck.

Likes

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
Reply
Loading...
Jun 05, 2012 0
Contributor ,
Jun 05, 2012

Copy link to clipboard

Copied

Thanks

Likes

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
Reply
Loading...
Jun 05, 2012 0
Explorer ,
Jul 05, 2012

Copy link to clipboard

Copied

Script doesn't work for me. Firstly, it opens a previous version the document which my new document in based on (and something opened recently) then it says "Error 45" object is invaild.

Likes

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
Reply
Loading...
Jul 05, 2012 0
Adobe Community Professional ,
Jul 05, 2012

Copy link to clipboard

Copied

@Aussie_leah – tell me more about your OS. Are you on Mac OS X or MS Windows?
How were the steps you did? Can you show some screen grabs? Especially the "Error" message…


I wrote and tested the script on Mac OS X, could not test for MS Windows.
Btw: the script is not able to open a document…

And: copy the code from answer #1 and make sure that you save it as a text only file.
Did you execute the script using the Scripts panel in InDesign CS6?

Uwe

Likes

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
Reply
Loading...
Jul 05, 2012 0
Adobe Community Professional ,
Jul 06, 2012

Copy link to clipboard

Copied

@Aussie_leah – can you provide a test case for me? Just an IDML exported that I can download to test my script?
What kind of hyperlinks are you using?

The script handles only destinations based on URLs…

Uwe

Likes

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
Reply
Loading...
Jul 06, 2012 0
Explorer ,
Jul 08, 2012

Copy link to clipboard

Copied

I am running on Windows 7. I copied and pasted the script into notepad and saved as a .jsx document. Found the scripts folder, pasted it in there and ran it through the scripts panel in InDesign. I don't know much (or anything) about scripts so I don't know if I did something wrong along the way.

And yes, the bug is on the Windows version.

Below is a screenshot of the error. Not sure if you can see much of it. But you might notice the tab opened at the top which opened itself when I ran the script.

error.jpg

Thanks for the link to the bug report page.

Likes

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
Reply
Loading...
Jul 08, 2012 0
Adobe Community Professional ,
Jul 08, 2012

Copy link to clipboard

Copied

@Aussie_leah – hm. This is rather unusual… I mean the tab with the "[converted]" document, that was opened immediately after starting the script.
"[Converted]" indicates, that there is a version from an older InDesign and opened. Why? I don't know…


Can you tell us more about the files you are working with and your workflow? The "e-news_0712.indd" and the other one converted. Did you open them from an older version of InDesign? Which one? Or, more important, are there other 3rd-party plug-ins installed?

The error message shown is unspecific, because I wrapped the whole functionality inside a function which in turn should be envoked by a "app.doScript()" function with some parameters, so that all actions can be made undone.

But before that, give my script another try.
But before doing that, export your InDesign file "e-news_0712.indd" to IDML, open that again in InDesign and run the version of my script against it.

If that is not working for you, try the following script code:

//Debug-version without undo for Aussie_leah exclusively

//if there is an error the ExtendScript Toolkit will be opened and the message will be written to the console.

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;

var d = app.documents[0];

if(d.hyperlinks.length === 0){alert("There are no hyperlinks in this document. Stop!");exit(0)};

var allHyperlinks = d.hyperlinks;

for(var n=0;n<allHyperlinks.length;n++){

    try{

    var newDestURL = decodeURI(allHyperlinks.destination.destinationURL);

    }catch(e){$.writeln(e.message); continue};

    try{

    var newDestName = decodeURI(allHyperlinks.destination.name);

    }catch(e){$.writeln(e.message); continue};

    try{

    allHyperlinks.destination.destinationURL = newDestURL;

    }catch(e){$.writeln(e.message); continue};

    try{

    allHyperlinks.destination.name = newDestName;

    }catch(e){$.writeln(e.message); continue};

    };

This script code is without the "app.doScript()" function and instead there are some "try{}catch()" routines, that will hopefully show some more specific errors. They will start another application and write the error messages inside the console of that additional application that comes along with every inDesign installation, the ExtendScript Toolkit (ESTK). In case of an error the ESTK will be opened and the error message(s) will be written there as text so that you can easily copy/paste it.

Be aware, that with that script you cannot undo the scripts actions in one go. So be careful and save your InDesign file to a new name after executing the script.

Uwe

Likes

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
Reply
Loading...
Jul 08, 2012 0
Explorer ,
Sep 04, 2012

Copy link to clipboard

Copied

Sorry for the delay in replying; I only do my e-news every 2nd month and last time I just used "tiny URL" to make the URL with equals signs and question marks work. But I have now tried the orginial script again and the same error occurred. I tried exporting the document as a IDML file but still the error came up. And I tried your new script on both the original and IDML file and neither worked.

My document is based on a file that was originally made in CS3 as I use the same format every time. When I first used it with my new CS6, I saved it as a coverted file. Still doesn't make a lot of sense why the old (uncoverted) versions would be opening when running a script though.

For me, this question is still unanswered and I can't see why Adobe won't fix it (maybe they can't). I know it will be a long time before I update to a new version of the Adobe suite again. I won't be giving them any more money just to keep producing new versions without proper checks.

Likes

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
Reply
Loading...
Sep 04, 2012 0
Adobe Community Professional ,
Sep 05, 2012

Copy link to clipboard

Copied

@Aussie_leah – sorry, to hear that…

I cannot offer a solution to your problems. Maybe there is no solution…
Without testing with your original files I cannot say, if it's possible at all to work around that bug.

I fear we have to wait for a bug fix by Adobe.
Working with a ".0.0" version sometimes (or often) brings trouble in real world production workflows. It's not only Adobe…

Uwe

Likes

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
Reply
Loading...
Sep 05, 2012 0
Adobe Community Professional ,
Oct 30, 2012

Copy link to clipboard

Copied

@Aussie_leah – unfortunately we have to wait (and pray?) that the next bug fix round will resolve this problem.
Version 8.0.1 does not…

Uwe

Likes

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
Reply
Loading...
Oct 30, 2012 0
Community Beginner ,
Jan 09, 2013

Copy link to clipboard

Copied

I have run into the same issue, don't pretend to have an answer for all the variables, but I do want to share a solution that is working for me.

Briefly, I need to embed hyperlinks to Google Maps from within Indesign/ePub. When I first attempted this, using hyperlinks that worked directly out of Word/Excel, etc., I, too, was getting extra characters inserted into my hyperlink in Indesign, causing the ePub link to fail. I contacted Adobe (case# 183925742). They indicated they problem was "hidden characters" within Excel, which is where I maintain my long list of Google hyperlinks. This is true--they had me cut and paste into notepad, then access Google Maps, then cut and paste back into Notepad, and then over to Indesign. To their credit, it worked.

However, I just found another, simpler solution, for what I am trying to accomplish, so here it is, and I hope it is helpful.

If I cut and past my hyperlink from Excel directly into my web browser, Google is able to "read my command line.  For example, my Excel string to find the Seaboard Air Line Railroad Depot in McBee, South Carolina is immediately below.  When I would try to paste this into Indesign/ePub, it would not properly export or link.   

Example: http://maps.google.com/maps?f=q&q=34.469167,-80.2575%20%28Seaboard%20Air%20Line%20Railroad%20Depot%2...

When this strink is entered into my web broswer, my web browser (Google) reads it and converts it to:

Example: https://maps.google.com/maps?f=q&q=34.469167,-80.2575+(Seaboard+Air+Line+Railroad+Depot+McBee+)

This is very different than my Excel link!

I then copy and past the converted string into Indesign, in the URL command line that is DIRECTLY below the very top of the Hyperlink pop up window.  I DO NOT use a secondary pop up window for the specific "paste."  I hope that makes sense.  In short, there are of course multiple ways to enter hyperlinks, but by using the URL "command line" near the top of the main pop-up, and then pasting in the "converted" Google Maps string, all of this now works for me.  I have exported approximately 40 such links to ePub, copied my ePub to my iPad, and am able to click on the link and go directly to Google Maps.

There may be a better way--I am hardly an expert w/Indesign, but this solved a major problem, at least for me.

I hope it's of value, BF  

Likes

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
Reply
Loading...
Jan 09, 2013 0
Community Beginner ,
Jul 09, 2013

Copy link to clipboard

Copied

Just a quick note to say that I am using InDesign CC and encountered this issue with hyperlinks. This script worked perfectly and all the links are now working and this has saved me a couple hours of copying and pasting the links back in manually in Acrobat!

Thank you!!!

Likes

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
Reply
Loading...
Jul 09, 2013 0
New Here ,
Jul 26, 2013

Copy link to clipboard

Copied

Thank you this was very helpful! I was using Window 7 and the fix worked where the others created errors.

Likes

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
Reply
Loading...
Jul 26, 2013 0
New Here ,
Jul 26, 2013

Copy link to clipboard

Copied

Sorry I forgot to mention I'm a Windows 7 user as well.  For me the work around - isn't an after the fact "work around"; it's actually using the tool's features. It's what I use when I'm creating links as I'm building a document.  The previous comment (77.KarynRH) souunded like someone looking for a solution - after - a document had already been created discovering the links didn't work. I could see the applicability of a script in that regard.  I'm not a professional ID user, and I'm probably not using the most efficient workflow given I test my document as I'm building it.  Anyway, I hope it helps.

Likes

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
Reply
Loading...
Jul 26, 2013 0
Contributor ,
Jul 29, 2013

Copy link to clipboard

Copied

Nope, it's just faster when I'm creating the document to create the hyperlinks as I did in CS5.5 (using the Hyperlinks panel), and then run the script when I've placed all of the links. Saving five seconds per link may not seem like much to you but I usually have enough hyperlinks that it adds up to something noticeable, especially since most of my hyperlinks are text and require a specific character style.

Likes

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
Reply
Loading...
Jul 29, 2013 0
Adobe Community Professional ,
Aug 27, 2013

Copy link to clipboard

Copied

I wonder if the issues with the Hyperlink URL encoding are now solved with InDesign's recent bug fix version 9.1.0 (InDesign CC):

http://helpx.adobe.com/indesign/release-note/indesign-cc-9-1-0-release-notes.html

Special characters such as ‘?’ or ‘=’ used in hyperlinks are converted to invalid characters and this results in broken links in the exported PDF. (#3554342)

Cannot test that, did not install CC …

Uwe

Likes

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
Reply
Loading...
Aug 27, 2013 0
Contributor ,
Aug 28, 2013

Copy link to clipboard

Copied

Hi,

I'd just swapped back to CS6 for a few days as CC was crashing on me so I haven't used the Hyperlinks for those days.

Your post prompted me to open CC and I'm happy to say my version of InDesignCC, 9.1,the Hyperlinks are working as they were intended to.

Finally!!!!

Tony

Likes

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
Reply
Loading...
Aug 28, 2013 0
Contributor ,
Sep 30, 2013

Copy link to clipboard

Copied

CS6 users can now rejoice... latest update claims to fix this...

http://helpx.adobe.com/indesign/release-note/indesign-cs6-2-release-notes.html

Likes

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
Reply
Loading...
Sep 30, 2013 0
Adobe Community Professional ,
Oct 01, 2013

Copy link to clipboard

Copied

Thank you for sharing this.
I couldn't test it yet.

My German InDesign CS6 v8.0.1 is showing no updates.
Maybe in a couple of hours or days?

Uwe

Likes

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
Reply
Loading...
Oct 01, 2013 0
Contributor ,
Jul 06, 2012

Copy link to clipboard

Copied

Hi Laubender,

I've just upgraded to CS 6, stumbled across the same problem, and found this forum post. I've also posted a bug report so hopefully the more of us report reported the faster they may fix it.

Thanks very much for the script, I'm on Mac OSx and it worked perfectly, will be a great help until Adobe fix the problem.

Cheers,

Tony

Likes

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
Reply
Loading...
Jul 06, 2012 0
Adobe Community Professional ,
Jul 07, 2012

Copy link to clipboard

Copied

@Tony – thank you for giving me positive feedback…

I wonder if the bug is present in the MS Windows version of InDesign CS6?
I'm still on Mac OS X 10.6.8…

And also wonder how this bug could slip through quality control. The new features of InDesign CS6 are very much centric to Digital-Publishing, Pad-, Phone-Publishing, and the Hyperlinks palette is central for building navigational elements in that area…
A glitch like that could damage the overall good user experience of the new version…

@gwhPoster – did you ever try out my script?

Did it solve the problem for you?

Uwe

Likes

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
Reply
Loading...
Jul 07, 2012 0
Contributor ,
Jul 07, 2012

Copy link to clipboard

Copied

Hi Laubender,

 

No problem, your script is a great help.

I just loaded a trial version of old Windows XP machine I've got, and can confirm that the problem is also on the Windows version.

The good news is that your script works just as well on Windows as it does on Mac OS X.

Tony

Likes

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
Reply
Loading...
Jul 07, 2012 0
Contributor ,
Jul 24, 2012

Copy link to clipboard

Copied

The script worked perfectly for me. In fact, it worked so well and quickly that if I hadn't run a script before, I probably would have thought nothing happened. I saw the telltale asterisk that appears when the file has been changed so I knew it executed.

Thanks so much for your help, Uwe. You truly do make a difference!

Likes

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
Reply
Loading...
Jul 24, 2012 0
New Here ,
Aug 01, 2012

Copy link to clipboard

Copied

We were having this same problem (Windows 7 & Windows XP)  and your script works great.   What a relief.  We publish a 4000 page book annually with close to 25,000 links, so you have saved me.  Thanks so much.

Likes

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
Reply
Loading...
Aug 01, 2012 0
Adobe Community Professional ,
Aug 01, 2012

Copy link to clipboard

Copied

@KarynRH & @ktroutman – thank you both for your positive feedback.

The original poster (OP), "gwhPoster", really should mark my answer in #1 as "correct"…
But maybe he did not try out the script and is still waiting for a bug fix in the upcomming InDesign version 8.0.1, which is not announced, yet.

Uwe

Likes

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
Reply
Loading...
Aug 01, 2012 0
Contributor ,
Aug 01, 2012

Copy link to clipboard

Copied

He should definitely mark it as correct. I used the script again today. I can't say I ever have a 4,000 page book or 25,000 links, but even with a half dozen links, it makes me very happy!

Likes

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
Reply
Loading...
Aug 01, 2012 0
LEGEND ,
Aug 01, 2012

Copy link to clipboard

Copied

I marked it -- one of the perks of being a moderator....

Likes

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
Reply
Loading...
Aug 01, 2012 0
New Here ,
Nov 01, 2012

Copy link to clipboard

Copied

Hi I tried running the script but it threw up this error:

Screen Shot 2012-11-01 at 11.12.06.png

I think it's maybe beause my link is a "Share to Twitter" and includes the text for the pre-written tweet.
Where this link is 'breaking' is the first url character between "tweet" and "text". It should read "tweet?text" not "tweet%3Ftext".
This is the only character that needs reverting. I'm asuming this kind of operation is too complex for a script?

Likes

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
Reply
Loading...
Nov 01, 2012 0
Adobe Community Professional ,
Nov 01, 2012

Copy link to clipboard

Copied

@Magic_monkey – Too complex? Hm. I don't think so. Maybe there are other obstacles in place here… Maybe it's too long?

Can you poste the full link here?

"tweet%3Ftext" in itself is not disturbing the procedure.
It will translate to "tweet?text".

See the following JavaScript snippet. If you open your ExtendScriptToolkit app (ESTK) and you are running the snippet, you see the correct result in the JavaScript Console (EDIT: together with an alert):

var stringToDecode = "tweet%3Ftext";

var decodedString = decodeURI(stringToDecode);

$.writeln("Decoded String:"+"\t"+decodedString);

alert("Decoded String:"+"\t"+decodedString);

Instead of "tweet%3Ftext" you could test with the whole URL string and report back here, if it goes right or wrong.

Uwe

Message was edited by: Laubender

Likes

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
Reply
Loading...
Nov 01, 2012 0
New Here ,
Nov 01, 2012

Copy link to clipboard

Copied

I haven't used JavaScript before so I don't really know what I'm doing but I put that snippet into the ESTK and I think it worked.
I tried it again with the full URL

http://twitter.com/intent/tweet%3Ftext%3DJust%2520read%2520Top%252010%2520Tips%253A%2520Axe%2520unne...

and it worked again, I think.
Screen Shot 2012-11-01 at 13.18.47.png

Thanks for taking your time to help me with this!

Likes

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
Reply
Loading...
Nov 01, 2012 0
Adobe Community Professional ,
Nov 01, 2012

Copy link to clipboard

Copied

@Magic_monkey – thank you for the full URL.

If I run the the full URL with the snippet and copy it from the ESTK Console to my browser it seems to work:

TwitterURLinBrowser.png


Don't know why it does not work within InDesign CS6.
Cannot test that right now…

Uwe

Likes

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
Reply
Loading...
Nov 01, 2012 0
Community Beginner ,
Nov 06, 2012

Copy link to clipboard

Copied

I found Uwe Laubender's script fails if you have internal links in your indd file. I made some enhancements to the script and pulled out the undo structure since I figured I could just save the doc under a new name if I was worried about it.

I also added console messages listing the updates, and added a success message at the end to give some comfort that things worked okay.

If you have external doc reference links, this script will fail since it loses context once the externally referenced document comes up. You can look at the console messages to determine which link is the problem - I've found the script processes the links from the bottom up when you compare it to the links in the hyperlink panel.

With this script, I'm able to keep using CS6 ... I'm not so surprised a bug like this crept into InDesign CS6, what surprises me more is the product's now 6 months old and something this fundamental has still not been fixed.

//DecodeURI_AllHyperlinks_2.jsx

//DESCRIPTION:Decodes all hyperlink destination URLs and names

//Uwe Laubender - enhanced by Joe Fugate

var d = app.documents[0];

var allHyperlinks = d.hyperlinks;

var totalLinks = allHyperlinks.length;

var repairedLinks = 0;

for(var n=0;n<allHyperlinks.length;n++){

   

    if ("documentPath" in allHyperlinks.destination) {

        var docPath = allHyperlinks.destination.documentPath;

        var linkName = allHyperlinks.name;

        $.writeln("Link " + n + ": " + linkName + ": URL: " + docPath + " external link");

        continue;

    };

   

    if ("destinationURL" in allHyperlinks.destination) {

        repairedLinks = repairedLinks + 1;

        var linkName = allHyperlinks.name;

        var newDestURL = decodeURI(allHyperlinks.destination.destinationURL);

        var newDestName = decodeURI(allHyperlinks.destination.name);

   

        allHyperlinks.destination.destinationURL = newDestURL;

        try{

            allHyperlinks.destination.name = newDestName;

        }catch(e){};

       

        $.writeln("Link " + n + ": " + linkName + ": URL: " + newDestURL + " repaired");

       

    } else {$.writeln("Link " + n + ": " + linkName + ": Not a URL link");};

};

alert("Successfully repaired "+ repairedLinks + " URLs");

Likes

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
Reply
Loading...
Nov 06, 2012 0
Adobe Community Professional ,
Nov 06, 2012

Copy link to clipboard

Copied

@aybee101 – thank you for testing and enhancing the script.

Maybe the ones who have trouble using the original version of the script will try another time with the new version to get their links in order…

Uwe

Likes

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
Reply
Loading...
Nov 06, 2012 0
Contributor ,
Jul 22, 2013

Copy link to clipboard

Copied

Great work Uwe! The script worked perfectly for me.

There's plenty of others reporting this bug here:

http://forums.adobe.com/message/4993979

I had also tried remaking the links in Acrobat. They tested fine after closing form editor, but on reopening the pdf, the encoding had changed.

InD 8.01, Acro 10.1.7, Win7/64, multiple pdf versions tried (Acro 5 and up).

Likes

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
Reply
Loading...
Jul 22, 2013 0
Adobe Community Professional ,
Jul 22, 2013

Copy link to clipboard

Copied

@afsdfasg – Wow.

If I get it right what you and the reports in your linked thread says…

The disease has spread…

to Acrobat Pro!

And: newer security updates to Acrobat Pro 9 could also be affected.

Not only Acrobat Pro X or XI.
I have to check myself;  I'm still doing 99% of my Acrobat work in version 9.4.4.

Not in the last supported one: 9.5.5.

According to this:

http://helpx.adobe.com/acrobat/release-note/release-notes-acrobat-reader.html

the latest and final release.

Acrobat Pro 10.1.7 is also installed, but not frequently used…

For hyperlinks generated in Acrobat Pro, can you specify the exact versions the bug occurs?

It seems to me that it would be extremely important for InDesign users to know about that.

Uwe

Likes

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
Reply
Loading...
Jul 22, 2013 0
New Here ,
Jul 25, 2013

Copy link to clipboard

Copied

My fix for problem with Adobe InDesign converting special characters in hyperlinks (e.g., hyperlinking images) does not involve any scripting or plug-ins.

I ran into the problem when trying to encode an AddThis social media sharing link that contained numerous special characters into an Interactive PDF end document such that when clicking on the link viewing the Interactive PDF online, it would crash Chrome, et al. browsers.  They worked fine when viewing the PDF from my computer, but as soon as I uploaded the PDF to my website and viewed it from a browser - no workie.

For example, InDesign would convert this:

addthis.com/bookmark.php?v=250&pubid=

To this:

addthis.com/bookmark.php%3Fv%3D250%26pubid%3D (effectively destroying the link)

How I worked around this is I would select the image I wanted to hyperlink, and paste the desired hyperlink into the URL window in the hyperlink panel.  Then I would go to the flyout menu of the hyperlink panel and select Hyperlink Destination Options.  I would then select Edit and paste in the actual URL I wanted and select OK. In the Hyperlinks panel, I would double check the URL displaced in the selected hyperlink.  Sometimes it was correct, but sometimes when repeating this process with other hyperlinked images, it was not.  When it wasn't correct, I would click on the down arrow in the URL window in the Hyperlink panel which opens up all of the hyperlinks ID has "recorded".  I would manually find the correct hyperlink that was entered in the "select Edit" step above.  This would ensure the correct formatted hyperlink with special characters was being used.  I would then save the doc. Export to Interactive PDF, and then upload the doc to my website.  When I navigated to the website in my browser, and clicked on the hyperlinks in question, they now work perfectly given the special characters where now preserved in the coding of the hyperlink.

Done.  No java scripts.  No plugins.  I just used the features of the tool that it took me two days experimenting with.  I haven't tried this with Buttons yet, I expect it would work the exact same way.

Hope this helps save someone some time

Likes

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
Reply
Loading...
Jul 25, 2013 0
New Here ,
Jul 25, 2013

Copy link to clipboard

Copied

That's a great workaround. Seems, however, that Adobe ought to recognize this bug & send us all a new version bug-free & at no cost.

Likes

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
Reply
Loading...
Jul 25, 2013 0
New Here ,
Jul 25, 2013

Copy link to clipboard

Copied

No kidding.  Seems like the tool is attempting to treat special characters as text it then converts into the hyperlink equivalent character (e.g., where a character space is represented as %20; an "&" is respresented as %26; equals sign "=" is represented by %3D; or whose where a "%" is represented by %25 in a hyperlink).  I use a lot of complex crazy long hyperlinks with lots of special characters for social media and mailto:liinks where I automatically populate the Subject line and Body with text.  I was just glad I didn't have to get into crazy scripting or pluggins to solve the problem.

All the best.

Likes

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
Reply
Loading...
Jul 25, 2013 0
Contributor ,
Jul 26, 2013

Copy link to clipboard

Copied

I find the script to be exceptionally easy to use. Since I usually have quite a few links, the efficiency and speed of the script is important to me; one click and I'm done. But I'm glad people are finding other workarounds.

Likes

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
Reply
Loading...
Jul 26, 2013 0
New Here ,
Dec 08, 2017

Copy link to clipboard

Copied

Thankyou so much for this, it's helped me fix what I've been struggling with all morning!

Likes

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
Reply
Loading...
Dec 08, 2017 0
New Here ,
Jun 06, 2012

Copy link to clipboard

Copied

Hi,

I was struggling with the same problem but was able to make it work by opening the Hyperlinks panel and manually amending the characters in the URL field (i.e. delete "%3F", key in "?"). Seems to publish to PDF with no issues. Hope that helps!

Likes

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
Reply
Loading...
Jun 06, 2012 0
Adobe Community Professional ,
Jun 06, 2012

Copy link to clipboard

Copied

@skim-creative – try out my script. It will change all hyperlink URLs and hyperlink names. You can undo the action in one go if you like…

Uwe

Likes

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
Reply
Loading...
Jun 06, 2012 0
New Here ,
Jun 27, 2012

Copy link to clipboard

Copied

Hi

I tried your script. I.e I copied the text to a text editor and saved as a .jsx file and placed within the script folder. When I ran it it gave an error number 14, no matching closing brace found?

Cheers Nigel

Likes

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
Reply
Loading...
Jun 27, 2012 0
LEGEND ,
Jun 27, 2012

Copy link to clipboard

Copied

Did you really copy the whole script? The braces look balanced to me.

Likes

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
Reply
Loading...
Jun 27, 2012 0
Adobe Community Professional ,
Jun 27, 2012

Copy link to clipboard

Copied

@Nigel – I can assure you, my script posted in answer #1 is complete…
No missing braces.

Uwe

Likes

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
Reply
Loading...
Jun 27, 2012 0
New Here ,
Jun 27, 2012

Copy link to clipboard

Copied

Hi

I will paste copied text (as below) into a text editor and save as a .jsx file and place within mt scripts. When I run it should I have text highlighted or just do so in the open document I want links to be corrected in?

Cheers Nigel

I have re-copied as this:

//DecodeURI_AllHyperlinks_DestinationURL_Name.jsx
//DESCRIPTION:Decodes all hyperlink destination URLs and names; can be undone in one go!
//Uwe Laubender
/**
* @@@BUILDINFO@@@ DecodeURI_AllHyperlinks_DestinationURL_Name.jsx !Version! Mon Jun 04 2012 14:48:49 GMT+0200
*/


app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;

app.doScript(_DecodeURI_AllHyperlinks_DestinationURL_Name, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT, "Decode all hyperlink URLs and names");

function _DecodeURI_AllHyperlinks_DestinationURL_Name(){


var d = app.documents[0];
var allHyperlinks = d.hyperlinks;

for(var n=0;n<allHyperlinks.length;n++){

    var newDestURL = decodeURI(allHyperlinks.destination.destinationURL);
    var newDestName = decodeURI(allHyperlinks.destination.name);

    allHyperlinks.destination.destinationURL = newDestURL;
    try{
    allHyperlinks.destination.name = newDestName;
    }catch(e){};

    };

}; //END function "_DecodeURI_AllHyperlinks_DestinationURL_Name()"


Likes

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
Reply
Loading...
Jun 27, 2012 0
Adobe Community Professional ,
Jun 27, 2012

Copy link to clipboard

Copied

@Nigel – just run the script with a double-click. Nothing selected. Hyperlinks palette closed (but I think that's not necessary).
Make sure that you save the script text in your text editor as "text only", that means not formatted eg to rtf or something..

Are you on Mac OSX or on MS Windows?
If on Mac, use TextEdit, copy the scripts' text to a new file, press cmd+shift+t to make it text-only.
Make sure that text-only-saving is encoded to "Unicode (UTF-8)".

Uwe

Likes

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
Reply
Loading...
Jun 27, 2012 0
Explorer ,
Jul 05, 2012

Copy link to clipboard

Copied

This does the same thing for me Just got CS6...so "advanced" it's got werid bugs that were never there before...grrrr!!! Very annoyed with Adobe right now. How do I report a bug?

Likes

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
Reply
Loading...
Jul 05, 2012 0
Adobe Community Professional ,
Jul 06, 2012

Copy link to clipboard

Copied

How do I report a bug?

@Aussie_leah – go there:

https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

But do not expect Adobe answering…

Uwe

Likes

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
Reply
Loading...
Jul 06, 2012 0
New Here ,
Aug 22, 2012

Copy link to clipboard

Copied

Hello! I also am having this problem. I tried running both of the suggested scripts; however, I get the following JavaScript error: Error Number 55. Error String: Object does not support the property or method 'destinationURL'

Does anyone have an idea how to make the script work? I'm using CS6, Version 8 on Windows 7.

Thanks in advance!!!

Likes

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
Reply
Loading...
Aug 22, 2012 0
Adobe Community Professional ,
Aug 22, 2012

Copy link to clipboard

Copied

@almostlindy – can you give me an example of the URL or target link you are using?

Uwe

Likes

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
Reply
Loading...
Aug 22, 2012 0
Adobe Community Professional ,
Aug 22, 2012

Copy link to clipboard

Copied

I have to see into this and maybe expand the script.

There are several destinations for Hyperlinks:

HyperlinkExternalPageDestination

HyperlinkPageDestination

HyperlinkTextDestination

HyperlinkURLDestination

ParagraphDestination

Don't know, if all those types are buggy…

Uwe

Likes

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
Reply
Loading...
Aug 22, 2012 0
New Here ,
Aug 22, 2012

Copy link to clipboard

Copied

Thanks!. An example url is: http://alamo.edu/main.aspx?id=5942. The hyperlink panel converts the ? and the = in the url, so that the resulting url is: http://alamo.edu/main.aspx%3Fid%3D5942.

Likes

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
Reply
Loading...
Aug 22, 2012 0
Adobe Community Professional ,
Aug 23, 2012

Copy link to clipboard

Copied

@almostlindy – My script should work well with that URL. Maybe there are other circumstances, that throw an error here…

For testing, did you try the script together with a fresh InDesign document that has only the above hyperlink URL?

How do you use the script?
Do you double click it from the Scripts Panel or do you start it from the ESTK (ExtendScript Toolkit)?

Uwe