Fetch URL over https using InDesign ExtendScript: now also for InDesign 2020

Note 1-Nov-2020: Make sure to check out my novel approach to GetURL: making curl available in ExtendScript. Not just for InDesign – any Adobe app that supports ExtendScript can use this. More info here:

https://coppieters.nz/?p=375

The ExtendExtendScript installer was updated to also cover InDesign 2020/macOS Catalina. Download link at the end of this post.

Easily the most popular feature of ExtendExtendScript is that it provides an easy-to-use replacement for the old GetURL() method I wrote long time ago (https://rorohiko.blogspot.com/2008_07_01_archive.html)

The old GetURL only supported unencrypted http. The replacement provided by ExtendExtendScript will handle encrypted https traffic too.

ExtendExtendScript is more than just GetURL(). It allows you to enhance ExtendScript with all kinds of functionality written with node.js.

Version 1.0.4 was released on 16-Dec-2019, and adds support for InDesign 2020 and macOS Catalina.

Example: downloading an image over https, after installing ExtendExtendScript becomes as easy as:

// Need to run in a persistent engine for callbacks to work
// Make sure to add JSInterface.jsx and json2.jsx

#targetengine TestSomewhere
#include "JSInterface.jsx"

function handleData(data) { 
        var fileURL = "~/Desktop/image.jpg";
        var file = new File(fileURL);
        file.encoding = "BINARY";
        file.open("w");
        file.write(data);
        file.close();
        alert("File downloaded to " + fileURL);
}

var url = "https://www.rorohiko.com/MagnetoGuides2-poster.jpg";
JSInterface.evalScript("JSInterface.plugins.getURL(JSInterface.getData())", url, handleData);

More info on what it is, how it works, how to use it, and the source code can be found here: https://coppieters.nz/?p=133

ExtendExtendScript is a labor of love, and maintaining this tool represents a substantial cost to my company, Rorohiko Ltd.

You can help avoid that ExtendExtendScript would become abandonware!

Building installers, testing, code signing, notarizing, providing free tech support and hand-holding: it all adds up.

If this extension is useful to you, help the bean counters at Rorohiko properly gauge how useful this is to you, and show your level of interest and appreciation by making a donation to [email protected] via PayPal.

One way to go about it could be to make an honest estimate of how much time and effort this tool has saved you, then send Rorohiko 5% or 10% percent of your savings.

Download link to the latest installer:

https://www.rorohiko.com/downloads/ExtendExtendScript.1.0.4.zip

2 thoughts on “Fetch URL over https using InDesign ExtendScript: now also for InDesign 2020”

  1. Hi Kris,

    I’m wondering whether this might help my problem at the moment. Essentially, I’m importing new data into my templates via XML – but as you know indesign won’t accept external (https) images.

    I’m guessing I’d need to write something that read the XML file, looped over it and pulled each design locally (using ExtendScript), overwrote the image url in the XML to it’s new local location… and then fire the new script at back at indesigns XML importer?

    1. Hi Adam!

      Yes, that’s probably what I’d end up doing as well. ‘Importing XML’ is a large subject and there might be details to your situation that could affect what I consider the best approach, but generally speaking, it sounds like a sensible approach.

Leave a Reply

Your email address will not be published. Required fields are marked *