addDocumentNoUI methods argument not selectable.
1.Your version of Adobe Illustrator
Illustrator ver.21 or later.
2.The steps you were taking when you experienced the issues
When we run addDocumentNoUI method, we can set startupPreset.
However, It always sets "Web" preset.
3.Your expected result
When we select "Art & Illustration" document open with appropriate preset.
4.Your actual result
All the time we got a document made with "Web" preset.
Here is a sample code of NoUI scripting.
var dc = app.documents.addDocumentNoUI("Art & Illustration");
//add some objects
dc.saveNoUI(File("~/Desktop/testNoUI.ai"));
dc.closeNoUI();
After run it and open in Illustrator, we will find it used Web preset.
We want to choose appropriate preset that we set.
var dc = app.documents.addDocumentWithDialogOption(“Art & Illustration”, false);
//add some objects
dc.saveAs(File(”~/Desktop/testNoUI.ai“));
dc.close(SaveOptions.DONOTSAVECHANGES);
Above script works for creating, saving and close the document without UI. The document preset is localized, if you are using locale other than english, you should pass the localized name of preset to addDocumentWithDialogOption method.
-
m1b commented
@Rama I just tested your sample script and it *does* show UI—it shows the new document as a normal document window. Therefore, this issue is not resolved.
-
Ten_A commented
Hi Silly-V,
Actually, no. The addDocumentWithDialogOption method has UI and it also supports only Web preset. -
Vasily Hall commented
Hey Ten_A - but is their new suggested command UI-less?
-
Ten_A commented
I tried your code in Illustrator CC(ver.22.1) and got an error[1162757463('WENE')] in the first line. And I tried to change documents preset(“Art & Illustration” to "Web") and got it work.
Probably, These methods support only "Web" preset.Ten.