Copy link to clipboard
Copied
Question:
Is there a way to set the Color Settings in Illustrator on MacOS with ExtendScript via the Document Preset so those color settings will be applied at the creation of the new document?
Use Case:
I have an Illustrator ExtendScript that will import images and arrange them on a layout along with specific metadata. In most cases, all of the images being placed should be tagged with the same profile. I'm grabbing the profile associated with the first image and would like to set the Color Settings to the settings associated with that profile (which I know) before I create the document to avoid profile mismatch warnings when placing the images.
MacOS Testing:
In simplied terms for testing, was thinking something like the following may work, but it's not changing the settings:
var myColorSettings = "North America Newspaper";
var docPreset = new DocumentPreset;
docPreset.colorSettings = myColorSettings;
var doc = app.documents.addDocument(DocumentColorSpace.CMYK, docPreset);
I also I tried the following variations of myColorSettings as well with no success:
Any ideas how to accomplish this?
Found the solution here to set the Color Settings:
var filespec = new File('/Library/Application%20Support/Adobe/Color/Settings/Recommended/North%20America%20Newspaper.csf');
app.loadColorSettings(filespec);Copy link to clipboard
Copied
Seems you may just have the `addDocument()` method arguments in the wrong order. The docs (found here) show the order as `app.documents.addDocument(startupPreset [, presetSettings] [, showOptionsDialog])`...
startupPreset | String | Startup preset to use |
presetSettings | DocumentPreset, optional | Preset document template |
showOptionsDialog | Boolean, optional | Whether to show options dialog |
Obviously, I don't have your "North America Newspaper" preset but I tried the below with the built-in "Mobile" preset and it seems to work fine.
var docPreset = new DocumentPreset();
docPreset.colorMode = DocumentColorSpace.CMYK;
var doc = app.documents.addDocument("Mobile", docPreset);
Let me know if this works or if I misunderstood your issue. Cheers!
Copy link to clipboard
Copied
Hey @jduncan, apologies if I wasn't clear. The "Mobile" setting you are referring to appears to be a "Document Profile". What I'm referring to are the Color Settings found under Edit » Color Settings » Settings. I'm looking for a way to set those before I create the Illustrator file to avoid profile mismatch warnings. Thought perhaps it could be done using a Document Preset, either by telling it which CMYK Working Space to use (icc profile), or the Color Settings file itself, but that may have been a pipe dream?
I don't know that I can change those settings with ExtendScript?
Copy link to clipboard
Copied
Found the solution here to set the Color Settings:
var filespec = new File('/Library/Application%20Support/Adobe/Color/Settings/Recommended/North%20America%20Newspaper.csf');
app.loadColorSettings(filespec);Find more inspiration, events, and resources on the new Adobe Community
Explore Now