Copy link to clipboard
Copied
I'm trying to find if it is possible to set a File object within Illustrator's source to be a web endpoint rather than a physical file on the local disk.
In a nutshell, I'm trying to reference files held centrally on a website rather than create local copies, which creates versioning issues not to mention wasted disk space.
Reading the 'Javascript Tools Guide' this does not seem to be supported, but wondering if anybody has any suggestions on addressing this limitation via other means?
Copy link to clipboard
Copied
Files need to be on the local disk (or on a file server), but web servers don't work.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Using a CEP panel and not strictly a .jsx file, sure, since you're able to access Node APIs and use anything ~V8 at your disposal. Do you use any JS frameworks, or are you only writing .jsx files?
There are some simple templating systems for CEP panels. You could retrieve content from the web via the panel JS, then likely pass it through CSInterface.evalScript() for whatever your personal needs would be, if not save the file to your local disk under a certain path then have the application open it.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You can create a File object from the window.__adobe__.cep.fs.writeFile() method if you can successfully stream the data from some other means like a Node API or npm package with unpkg. Since you have I/O and file system access on the CEP side of Javascript and not strictly scripting/Extendscript, you should be able to retrieve the data (many npm modules and libraries for this depending on where that file is), write to the local file system via the method above, then on successful write (believe the function is synchronous) prompt the host app to open that above file in whatever location you placed it.
Copy link to clipboard
Copied
Here is another solution. You can use process commands with CEP.
var cmd = "/usr/bin/curl";
var arg1 = "https://ten5963.wordpress.com/";
var createProcessResult = window.cep.process.createProcess(cmd, arg1);
if (createProcessResult.err==0) {
gPID = createProcessResult.data;
var stdoutResult = window.cep.process.stdout(gPID, function(output) {
console.log(output);
});
}
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more