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

Issues with a code: GetURLs

Participant ,
Jun 01, 2023 Jun 01, 2023

Copy link to clipboard

Copied

Dear Readers,

 

I am reaching out to you because I am currently facing issues with a downloaded code that I am trying to use in Adobe InDesign. I obtained the script from the following link: http://rorohiko.blogspot.com/2013/01/geturlsjsx.html.

 

The problem arises when I try to run the code (in the latest version of InDesign on the Mac). I receive an error message and I am unable to execute the code correctly. I have attached the relevant InDesign document containing the code for your reference.

 

Would someone be kind enough to assist me with this? I would greatly appreciate any help that can be provided.

Thank you very much in advance!

 

Schermopname 01-12- .pngexpand image

TOPICS
Scripting

Views

287

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 ,
Jun 01, 2023 Jun 01, 2023

Copy link to clipboard

Copied

Hi @brown1982 ,

what is the URL you like to use?

 

Regards,
Uwe Laubender
( Adobe Community Expert )

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 ,
Jun 01, 2023 Jun 01, 2023

Copy link to clipboard

Copied

Did you make the changes suggested by Kris the script author regarding issues with CS5 in the ParseURL method? I quote the relevant section below. This could be mostly likely relevant in latest version as well

With regards to InDesign CS5: the downloadable code won't work as-is with CS5 due to some oddity with the String.replace function.

To work around the issue, you need to change the ParseURL function to read:

...
function ParseURL(url)
{
url=url.replace(/([a-z]*):\/\/([-\._a-z0-9A-Z]*)(:[0-9]*)?\/?(.*)/,"$1/$2/$3/$4");
url=url.split("/");

// ADD THE LINE BELOW FOR INDESIGN CS5
if (url[2] == "undefined") url[2] = "80";

var parsedURL = 
...

That fixes it up so it works with CS5 too...

 For details see the following blogpost

http://rorohiko.blogspot.com/2008_07_01_archive.html

-Manan

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
Participant ,
Jun 02, 2023 Jun 02, 2023

Copy link to clipboard

Copied

Yes it was already in there. You could also see that in the package i send, the script was included.

brown1982_0-1685707795799.pngexpand image

 

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
Participant ,
Jun 02, 2023 Jun 02, 2023

Copy link to clipboard

Copied

Apologies for the oversight. I have now realized that my files were not included. Here are the files I intended to add. 
https://we.tl/t-Fy3H7Enhlw

 

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
Contributor ,
Jun 26, 2023 Jun 26, 2023

Copy link to clipboard

Copied

Man, that code is _old_. I've since had at least two rewrites and other approaches which work better.

Unless you really, really want to use that old code, make sure to check out JSXGetURL (https://coppieters.nz/?p=720) and ExtendExtendScript https://coppieters.nz/?p=220 

If you have good reason to want to use this very old version, let me know, but if I could choose, I'd prefer to put the old GetURL.jsx out to pasture...

 

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
Contributor ,
Jun 26, 2023 Jun 26, 2023

Copy link to clipboard

Copied

LATEST

Also, you haven't answered Uwe's question: what is the URL you're trying to access by way of getURL? I suspect that might be where the issue lies.

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