@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!)
//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[n].destination.destinationURL );
var newDestName = decodeURI( allHyperlinks[n].destination.name );
allHyperlinks[n].destination.destinationURL = newDestURL;
try{
allHyperlinks[n].destination.name = newDestName;
}catch(e){};
};
}; //END function "_DecodeURI_AllHyperlinks_DestinationURL_Name()"
Hope that helps.
Uwe
IMPORTANT NOTE:
The code above was damaged before. Why? This happened at the end of 2019 when this thread was moved over from the old InDesign forum to this new InDesign forum. A lot of script code from a lot of threads were affected back then. I corrected the code now.
Regards,
Uwe Laubender
( ACP )