Copy link to clipboard
Copied
The following is my code. It works when I use version 2023, but it fails when I use version 2024. The error message is "Cannot get document 1"
save aiDoc in file mynewfilepath as Illustrator ¬
with options {class:Illustrator save options, embed ICC profile:true, flatten output:preserve appearance}
Please help me
This does appear to be a bug. The error occurs when the `save` command’s `with options` parameter is a record containing a `embed icc profile` property.
Your command is valid but fails on AI 28.7.6 and AI 29.5 (macOS 15.3.2):
set mynewfile to "/Users/jsmith/test.ai" as POSIX file -- change this to your actual path
tell application "Adobe Illustrator"
save document 1 in mynewfile as Illustrator with options ¬
{class:Illustrator save options, flatten output:preserve appearance, embed icc p
...
Copy link to clipboard
Copied
This does appear to be a bug. The error occurs when the `save` command’s `with options` parameter is a record containing a `embed icc profile` property.
Your command is valid but fails on AI 28.7.6 and AI 29.5 (macOS 15.3.2):
set mynewfile to "/Users/jsmith/test.ai" as POSIX file -- change this to your actual path
tell application "Adobe Illustrator"
save document 1 in mynewfile as Illustrator with options ¬
{class:Illustrator save options, flatten output:preserve appearance, embed icc profile:false} -- this errors!
end tell
However this works:
set mynewfile to "/Users/jsmith/test.ai" as POSIX file -- change this to your actual path
tell application "Adobe Illustrator"
save document 1 in mynewfile as Illustrator with options ¬
{class:Illustrator save options, flatten output:preserve appearance} -- this works
end tell
In addition, the “Can’t get document 1” error message is incorrect as the problem is the `with options` parameter, so that’s a second bug. (I’ll assume you do have at least one document open. Ironically, if you don’t, AI correctly returns an error but this time the message is “File/Folder expected” instead of “Can’t get document 1”, so that’s three bugs in the `save` command!)
You can file your bug report here:
Copy link to clipboard
Copied
Thank you very much for your help. I don't have a Facebook account, so I can't fill in the BUG. If you can, can you help me submit this BUG?
Do you know that JavaScript will also have the same problem?
Copy link to clipboard
Copied
You can create an account with your email address; you don’t need Facebook (I don’t have it either).
JavaScript appears to work correctly:
var d = app.documents[0];
var saveOptions = new IllustratorSaveOptions();
saveOptions.flattenOutput = OutputFlattening.PRESERVEAPPEARANCE;
saveOptions.embedICCProfile = true;
d.saveAs(new File('~/testjs.ai'), saveOptions);
Copy link to clipboard
Copied
Thank you very much for your help
Copy link to clipboard
Copied
I submitted a bug report for this. Please help by upvoting it.
https://illustrator.uservoice.com/forums/601447-illustrator-desktop-bugs/suggestions/49839756-apples...