JSXGetURL 0.0.9 Update

UPDATE: Feb 13, 2024. This page is outdated, and JSXGetURL 1.x.x has been released. Visit

https://www.rorohiko.com/jsxgeturl

What is it?

JSXGetURL enhances ExtendScript to make it easy to access servers using http or https β€“ e.g. to download assets from a remote server.

JSXGetURL is meant to work with any Adobe Creative Cloud application that has ExtendScript support – InDesign, InDesign Server, InCopy, Illustrator, Photoshop…

JSXGetURL is implemented as an ExtendScript DLL/framework, written in C/C++.

This DLL allows you to access URLs (including https: or ftp:) straight from ExtendScript.

There is nothing to install – all you need to do is //@include a .jsx file which then loads the DLL.

Sample code:


//@include "JSXGetURL/JSXGetURLLoader.jsx"
var getURL = JSXGetURL();

getURL.addRequestHeader("Accept: */*");
var s = getURL.get("https://www.rorohiko.com") + "";

alert(s.substr(0,1000));

var headers = getURL.getResponseHeaders();
alert(headers);

// Some random FTP file for testing

var f = new File("~/Desktop/sha512.sum");
var s = getURL.get("ftp://cygwin.com/pub/gcc/sha512.sum", f.fsName);

// Some zip file to test binary file download

var f = new File("~/Desktop/FrameReporter.1.1.8.zip");
getURL.get("https://www.rorohiko.com/downloads/FrameReporter.1.1.8.zip", f.fsName);

JSXGetURL is a wrapper around libcurl which in turn is using open source code from OpenSSL, Boost, zlib.

The last few weeks, I put a fair bit of work in updating JSXGetURL. Version 0.0.9 is now available:

https://www.rorohiko.com/downloads/rr612412/JSXGetURL.0.0.9.zip

Changes

  • Added some simple functions to access request and response headers.
  • M1 support on Mac
  • Upgraded a bunch of dependencies. JSXGetURL now uses
  • zlib 1.2.13
  • Boost 1.81.0
  • OpenSSL 3.0.7
  • Curl 7.81.0
  • Visual Studio 2019 on Windows
  • Xcode 14.2

Licensing

The .zip file contains a fully functional, time-bombed version of JSXGetURL – it will expire on 30-June-2023.

I am currently still working hard on the Tightener project, and by then I hope to have the licensing module in Tightener functional enough to handle a licensing scheme for JSXGetURL. I’ve tried to run JSXGetURL as a ‘sponsored/donationware’ project for a few years, but that has not worked. From June onwards, there will be some subscription fee to be paid for continuous use.

13 thoughts on “JSXGetURL 0.0.9 Update”

    1. Hi Alex,

      The JSXGetURL library would not be the right tool for the job.

      A lot depends on the context you are operating in.

      If you’re running in a CEP panel, then you can install and use any Node/JS modules directly – no need for any external help. There’s documentation to be found for this on the internet.

      If you’re running an ExtendScript, then you can either create the necessary glue code yourself, or you could look into JSInterface, which I used for a previous incarnation of ‘Get URL’. JSInterface allows you to call Node/JS modules from ExtendScript, so you should be able to install the node module, then use JSInterface and expose the Node functionality to ExtendScript.

      JSInterface is mentioned and downloadable from here:

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

      Look for “ExtendExtendScript” in the article text.

      I’ve now also incorporated JSInterface into CEPSparker, to make it easier to break through the ExtendScript – Node/JS division in a symmetrical way (use CSInterface to call from CEP and Node/JS -> ExtendScript, use JSInterface to call from ExtendScript -> CEP and Node/JS)

      https://github.com/zwettemaan/CEPSparker

  1. Good day. Awesome work! I have a question about post. I have played around with “s = getURL.post(url, body);” and I can get a 200 response with my payload in body. But is there a way of retrieving the data returned from the server? I get an error message in s or empty if the call is a success from what I can tell.

    Kind regards.

    1. Not sure – I don’t think I tested this much. I tried this:

      //@include "JSXGetURL/JSXGetURLLoader.jsx"

      var getURL = JSXGetURL();

      var s = getURL.post("https://httpbin.org/post","{\"this\":\"1\",\"is\":\"2\"}") + "";
      alert(s);

      And that seems to return some data into s, so as far as I can tell, the POST does play ping-pong.

      1. Thank you so much. I got at it again and found my issue. A real doh moment. I copied the headers from my postman experiments. Including :

        getURL.addRequestHeader(“Accept-encoding: gzip,deflate,br”);

        This was the reason I got empty return. Again, thank you.

  2. Hi there, it’s 11-May-2023 and using JSXGetURL I’m getting the demo timed out response. I really found this project useful! Thanks πŸ™‚

    1. Is this with the latest version? I just tried it out and as far as I can tell, it works fine. Make sure you use the latest:

      https://www.rorohiko.com/downloads/rr612412/JSXGetURL.0.0.9.zip

      This will run until the end of June. After that, I hopefully will have a licensing/payment scheme in place, based on Tightener, and for version 0.1.0 onwards, there probably will be some licensing fee for non-demo use…

      1. Cheers for the reply.

        Yes, it was the latest version. My application is transpiled and copied into the InDesign scripts folder on build and was working before the previous version of your library expired. So I dropped in the new version’s JSXGetURL folder into my application and got “DEMO TIMED OUT” response when I ran it.

        Then I copied in sample.jsx manually and received a “getURL.addRequestHeader is not a function” error. Next I removed the offending line, and again got the “DEMO TIMED OUT” response. On a hunch to do with some sort of caching ocurring within InDesign, I moved the script and library to a new folder in the scripts directory, and et voila it works!

        So, does this mean that InDesign is caching the old version of the framework? Any ideas would be much appreciated.

        PS I use it your package to grab data from an API for my own private use (I dynamically build my CV from a Sheets document. Thanks for your work!

  3. After a bit of poking around, resetting InDesign’s preferences by deleting these files does the trick, however you lose all customised settings:

    ~/Library/Caches/com.adobe.indesign
    ~/Library/Preferences/Adobe InDesign

  4. Hi kris,
    First, thanks for your JSXGetURL. It is excellent and very useful to us. I was wondering if you could already tell if there is a new version from the beginning of July available and what the licensing model will look like. Many thanks in advance!

    1. I am still working on the licensing functionality in Tightener, which will ultimately be used to convert JSXGetURL into a commercial product. The most probable licensing model will be a yearly recurring per-workstation fee, probably around US$30. Unlimited licenses will probably also be available, based on some yearly fee of a few US$1000. All of this is still very much undecided.

      I will probably release another time-bombed version until 31 Dec 2023, to bridge the gap until I am ready to release the licensed version…

Comments are closed.