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

•  "Export as" doesn't embed the Adobe RGB (1998) profile, via Javascript (is this a limitation?)

Enthusiast ,
Nov 25, 2025 Nov 25, 2025

Hello -

 

I made a small Javascript that export all/some artboards with the below parameters cfr. screenshot).
But for a reason or another the profile is incorrect. It's sRGB when it must be Adobe RGB (1998).

Do I miss something, or is it a limitation of the "system" (as pretend AI like Claude).
If it isn't a liitation, what the correct line code to embed Adobe RGB profile?

app.activeDocument.colorProfileName = 'Adobe RGB (1998)';"
…
var jpegOptions = new JPEGSaveOptions();
    jpegOptions.quality = 10;
    jpegOptions.embedColorProfile = true;

 

Many thanks for any feedback
Enjoy your day.
 
 

- Dimitri

 

TOPICS
Scripting
232
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

correct answers 1 Correct answer

Community Expert , Nov 25, 2025 Nov 25, 2025

Hi @dimitri_cas remarkably Illustrator doesn't provide the spripting API with access to assigning ICC profiles. Literally all we can do is see what profile is assigned (read only). Even Actions can't seem to assign them. Not good.

 

In your case, do you need to assign the profile and then export the jpg, or have you already assigned the desired profile? If you already have the correct profile assigned, you can use exportForScreens and set the `includeICCProfile` to true.

 

Something like this fu

...
Translate
Adobe
Community Expert ,
Nov 25, 2025 Nov 25, 2025

Hi @dimitri_cas remarkably Illustrator doesn't provide the spripting API with access to assigning ICC profiles. Literally all we can do is see what profile is assigned (read only). Even Actions can't seem to assign them. Not good.

 

In your case, do you need to assign the profile and then export the jpg, or have you already assigned the desired profile? If you already have the correct profile assigned, you can use exportForScreens and set the `includeICCProfile` to true.

 

Something like this function I used for something a while ago:

/**
 * Export all artboards as JPG.
 * @author m1b
 * @version 2024-10-18
 * @param {Document} doc - an Illustrator Document.
 * @param {Folder} [exportFolder] - the folder to export to (default: document's folder).
 */
function exportJPG(doc, exportFolder) {

    var options = new ExportForScreensOptionsJPEG();
    options.antiAliasing = AntiAliasingMethod.ARTOPTIMIZED;
    options.compressionMethod = JPEGCompressionMethodType.BASELINESTANDARD;
    options.embedICCProfile = true;
    options.scaleType = ExportForScreensScaleType.SCALEBYFACTOR;
    options.scaleTypeValue = 1;

    var itemToExport = new ExportForScreensItemToExport();
    itemToExport.artboards = 'all';
    itemToExport.document = false;
    exportFolder = exportFolder || doc.path;
    doc.exportForScreens(exportFolder, ExportForScreensType.SE_JPEG100, options, itemToExport);

};

 

(you will have to adjust the settings to suit your situation.)

 

However if you need to export as a different profile than the actual .ai document, the only way I can think of is to (1) export as JPG from Illustrator (or better: a lossless format, eg flat psd) then (2) use BridgeTalk later in the same script to tell Photoshop to open the exported image file and assign the desired ICC profile, then save it (or save as/export as JPG).

 

Sorry it isn't an easy answer.

- Mark

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 ,
Nov 25, 2025 Nov 25, 2025
LATEST

Hello m1b  🙂

Let's be honest, you rock 🤘
I think it will make a very good base (starting point) for what I need.
As you said, of course, I'll have to improve it. But I'm quiet optimist  😀
NB. I dunnon didn't thought about this "Export for Screens…", May be cuz I never use this "option".

 
Thanks a lot…
 

 

- Dimitri

 

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