Download link further below…
What is it?
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.
Hello, I was wondering if the library can somehow be used to utilise an external JS module, namely https://github.com/commenthol/date-holidays, to get a JSON data based on provided input? Thank you.
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