Applescript—cannot save Illustrator file if embedding ICC profiles
This is a bug, as verified by this post (https://community.adobe.com/t5/illustrator-discussions/there-is-a-problem-with-saving-as-illustrator-using-applescript/m-p/15287552) and this post (https://community.adobe.com/t5/illustrator-discussions/applescript-cannot-embed-icc-profiles-in-illustrator-save-options/m-p/15032019#M429674). I cannot save an Illustrator file as part of an AppleScript if ICC profiles are being embedded. This is a problem because I can no longer use my Applescripts for creating versions of logo files.
The following code will fail with the error "Cannot get document 1". The error occurs when the save
command’s with options
parameter is a record containing a embed icc profile
property.
save document 1 in filePath as Illustrator with options {embed icc profile:true}
I have verified that a) the ICC profile was already embedded in the source document, and that if I save the file via the GUI, checking the box to save the ICC profile works. Using AppleScript to save the Illustrator file does not retain the ICC profile.
This fails on macOS 14.5 and Illustrator 27.x and 28.5. It also fails on macOS 15.4 and Illustrator 29.5.0. It also fails on macOS 15.3.2 and Illustrator 28.7.6 and 29.5.
According to another user, JavaScript works properly. However, JavaScript is not a workaround for me.
var d = app.documents[0];
var saveOptions = new IllustratorSaveOptions();
saveOptions.flattenOutput = OutputFlattening.PRESERVEAPPEARANCE;
saveOptions.embedICCProfile = true;
d.saveAs(new File('~/testjs.ai'), saveOptions);
Please help -- I need to be able to save an Illustrator file with AppleScript, that has an embedded ICC profile.
