Skip to main content
Participating Frequently
May 15, 2023
Answered

How to send File object from illustrator to extension using extend script

  • May 15, 2023
  • 2 replies
  • 682 views

I want to send selected image from illustrator to extension but not getting how to resolve this issue 

This topic has been closed for replies.
Correct answer Inventsable

You can only communicate via strings between the environments, even if this is JSON that you parse once loaded. CEP extensions have plenty of utilities for handling files especially via NodeJS, but this depends entirely on what you're intending to do. If you want to display images created in app in some CEP extension, you're better off exporting the file from JSX, returning filepaths to CEP, then reading the filepaths in CEP as something like base64 and assigning it to an img src attribute like here.

2 replies

Inventsable
InventsableCorrect answer
Legend
May 18, 2023

You can only communicate via strings between the environments, even if this is JSON that you parse once loaded. CEP extensions have plenty of utilities for handling files especially via NodeJS, but this depends entirely on what you're intending to do. If you want to display images created in app in some CEP extension, you're better off exporting the file from JSX, returning filepaths to CEP, then reading the filepaths in CEP as something like base64 and assigning it to an img src attribute like here.

Community Expert
May 17, 2023

What are you planning to do with that image? As far as I can remember we can only send string objects back from Extendscript via the callback of evalScript method or via the CSXS event. However, you should not need to send the image to extension normally as the extension does not have access to any API to modify or change it. Please explain a bit more on what you are trying to do.

-Manan

-Manan