Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Illustrator File object - web based source?

Community Beginner ,
Oct 11, 2019 Oct 11, 2019

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?

TOPICS
Scripting
998
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Oct 11, 2019 Oct 11, 2019

Files need to be on the local disk (or on a file server), but web servers don't work.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 11, 2019 Oct 11, 2019
OK, thank you. I assumed so, but was hopeful there was some kind of work around. Perhaps this could be considered as a feature request?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 11, 2019 Oct 11, 2019
Please post feature requests to http://illustrator.uservoice.com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 14, 2019 Oct 14, 2019

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 15, 2019 Oct 15, 2019
Thanks, we are using CEP. We do not use Node but are using Jquery. As a fallback plan I figured we could retrieve file data from an API call, and then store that locally on disk as a temporary means; while not ideal, it is a workaround. I did not see anywhere in the documentation that you could create a File object from a stream or byte array, so assume that it is necessary to download the document first.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 15, 2019 Oct 15, 2019

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 15, 2019 Oct 15, 2019
LATEST

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

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines