ExtendExtendScript/GetURL: now with a simple installer

Note 23-Jan-2023: 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://www.rorohiko.com/jsxgeturl

If all you want to get is an easy-to-use GetURL function for InDesign ExtendScript, I now have a simple installer to install ExtendExtendScript with the GetURL plug-in.

Version 1.0.4 was released on 16-Dec-2019 and supports InDesign 2020/macOS Catalina. This is a labor of love, and maintaining this tool is a substantial cost to Rorohiko. If this extension is useful to you, help us properly gauge how useful this is to you, and show us your level of interest and appreciation by donating via PayPal to [email protected]. If there is sufficient interest and appreciation, we’d be encouraged to keep on releasing updates!

Download it here: https://www.rorohiko.com/downloads/ExtendExtendScript.1.0.4.zip

Important: no warranties, neither expressed nor implied: use at your own risk.

You can find the source code and read more about ExtendExtendScript and how it works in some of my other posts: https://coppieters.nz/?p=133

If you’re not interested in how ExtendExtendScript works and all you want to do is access some URL from ExtendScript, this installer is for you.

The ExtendExtendScript extension is invisible. All it does is augment the InDesign ExtendScript environment with some new functions you can call.

It only works from a persistent ExtendScript engine; don’t run it from the ‘main’ engine, which is not persistent.

After installing this extension you can access a full-fledged HTTP/HTTPS downloader callable from ExtendScript, and you can write ExtendScript code like the following examples:

// 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);
}

// Download an image file in ExtendScript over https
var url = "https://www.rorohiko.com/MagnetoGuides2-poster.jpg";

JSInterface.evalScript(
  "JSInterface.plugins.getURL(JSInterface.getData())", 
  url, 
  handleData);

Or

// 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"

// Some sample ExtendScript code. Fetch a URL over https and display 
// in an alert

function handleData(data) { 
 alert(data);
}

var url = "https://www.rorohiko.com/welcome.msg";

JSInterface.evalScript(
  "JSInterface.plugins.getURL(JSInterface.getData())", 
  url, 
  handleData);

This installer came about because I had built a more or less ‘standardized’ installer for installing the more recent software I wrote for Rorohiko. This installer does not rely on the ExManCmd command line tool, so it should be more robust. ExManCmd fails way too often, so I avoided using it.

And because I had the installer available anyway, I decided to roll off a copy just for ExtendExtendScript. Hope it proves useful!