Illustrator (Desktop) SDK/Scripting Issues
121 results found
-
Change units in an open document
For an active document, we can get the key value of the ruler units through the app.activeDocument.rulerUnits property.
We can also create a new document with the desired units:
var docPreset = new DocumentPreset;
docPreset.units = RulerUnits.Centimeters;
var newDoc = app.documents.addDocument("Web", docPreset);And can we switch to other ruler units in the document? NO! Because the app.activeDocument.rulerUnits property is read-only, not read/write.
And it's not logical. So it just needs to be linked to the Document Setup > Units dialog mechanism.
In Adobe Community or direct messages comes from users asking how to change units of measure. I came up…
5 votes -
[Typo] View rotateAngle property in omv.xml
For several years, the same incorrect information about the document rotation property has been repeated in the omv.xml (Object Model Viewer) file in folder "Scripting Dictionaries CC". Checked in СС 2023, 2024, 2025
/Library/Application Support/Adobe/Scripting Dictionaries CC/Illustrator [vers.]/omv.xml
At the same time, the PDF documentation "Adobe Illustrator Scripting Reference: JavaScript", the property name is correct.
Expected Property Name:
rotateAngleActual Property Name in omv.xml:
rotate<classdef name="View" dynamic="true">
....
<property name="rotate">
<shortdesc>The rotation angle of this view.</shortdesc>
<datatype>
<type>number</type>
</datatype>
</property>
...
</classdef>3 votes -
[Typo] app.tracingPresetList of Illustrator JavaScript Reference.pdf
There is a typo in app.tracingPresetList in Illustrator JavaScript Scripting Reference.pdf. The wrong property name is listed and developers and users cannot get tracingPreset. It would be helpful if it could be corrected.
According to my research, this is wrong from CS2 version to the current (2024 v1).
Expected Name:
app.tracingPresetsList (add "s" to Preset -> Presets)
Actual Name:
app.tracingPresetList ("s" is missing from Presets)
7 votes -
AIArtStyleParser->CreateNewStyle not working in Illustrator 28.7 with SDK Build 130 and 709
AIArtStyleParser->CreateNewStyle return 0 (no error) but also the pointer to the new AIArtStyleHandle is invalid.
Also AIArtStyleParser->NewPaintFieldStroke doesn't work.It worked in previous Illustrator Beta releases with SDK Build 130 (April 2024)
1 vote -
When getting ink.name, encoding gets broken for non-Latin languages: Chinese, Japanese, Russian, etc.
A script cannot support Chinese, Japanese and other languages when getting ink.name, and it displays garbled characters.
var doc = app.activeDocument;
var inkList = doc.inkList;
var inkUsage = [];for (var i = 0; i < inkList.length; i++) {
var ink = inkList[i];
var inkName = ink.name;
inkUsage.push(inkName);
}alert(inkUsage.join("\n"));
$.write(inkUsage.join("\n"));This test script above gives a result like in the screenshot attached.
Problem found by Aprking
Original discussion:
https://community.adobe.com/t5/illustrator-discussions/how-to-make-the-script-support-chinese-japanese-and-other-languages-when-getting-ink-name/m-p/142477916 votes -
[BUG] exportFile() changes spaces to hyphens in file name
//how to reproduce:
app.activeDocument.exportFile(new File("~/desktop/test test"), ExportType.GIF);//types affected - ExportType.PNG24, .PNG8, .JPEG, .GIF //types exporting with no unwanted hyphen - .TIFF, .SVG
//persists on win and mac
2 votes -
Live Effect process loses spot color info in single spot color Raster
In a Live Effect, a kRasterArt element, which is a raster of a single spot color, loses color information between kSelectorAIEditLiveEffectParameters and kSelectorAIGoLiveEffect.
This especially becomes a problem when removing the Effect from the element.
Reproducible steps:
1. Rasterize an element with a spot fill, no stroke
2. Apply 'Outer Glow' Effect
3. Save, close, and reopen the document
4. Remove 'Outer Glow' EffectI've copied the TwirlFilter sample code from the 2024 SDK, called it TestFilter and simplified the code. It has only been built and run on macOS.
It demonstrates the color loss between these 2 selectors through…3 votes -
Broken embedICCProfile in export
For TIFF, PSD exports, there are new ExportOptionsPhotoshop() and new ExportOptionsTIFF() in the ExtendScript object model, and a Boolean attribute embedICCProfile that embeds a color profile in exports. But if we set it to true, the profile still won't be embedded.
I've explored versions of Adobe Illustrator. Illustrator CS6 - embedICCProfile property worked, but in the next version of CC (v17) embedICCProfile was broken and in the next versions it didn't change, it's been ten years!
How to test:
1) Rename exportTif.txt to exportTif.jsx and run it. The script will export the first artboard of the document in TIFF to…7 votes -
1 vote
-
Bug: JavaScript unary operators "+" and "-" do not function as documented for UnitValue objects
According to the Illustrator ExtendScript documentation, applying the unary operators "+" or "-" to a UnitValue object should respectively produce the numeric value or the negated numeric value of the UnitValue. However, they instead respectively produce the UnitValue unmodified or the UnitValue with its value negated.
Either the documentation or the behaviour should be updated to reflect the other.
I observed this behaviour in Illustrator 28.5 on Mac OS Sonoma.
The behaviour may be quickly tested with the following script:
var uv = new UnitValue(2, "px");
alert(
"Results:" +
"\nUnitValue unmodified: \"" + uv + "\" (" + (typeof uv)…3 votes -
Document.save() for eps/svg/pdf documents changes them to ai files
en_US
Document.save() is a method to save over a document. In keyboard shortcut, it is equivalent to command+S.
However, when ExtendScript's save() is executed on a document that preserves Illustrator editing capabilities such as eps/svg/pdf, it will be saved as an ai document instead of being overwritten as its original format.
For example, when save() is executed for the document
1.eps
, the file1.ai
will be created in the folder where the eps is placed. If the file1.ai
already exists, it will be overwritten with the contents of1.eps
and the original1.ai
will be lost.Environment
- macOS…
15 votes -
2 votes
-
Executing the script throws the Error 1242: Illegal argument
平素は誠にお世話になっておりますAdobe製品の機能評価をしております
Adobe製品の機能評価をしておりますが対応策があれば教えていただければ幸いです
[Windows11 Pro 22H2] Adobe Illustrator27.9で次のJavaScriptを実行するとError 1242:Illegal argument -argument 1のエラーとなりましたのでバグとして報告いたしますvar textValue = null;
var selectedFont = null;
// アクティブなドキュメントを取得
var doc = app.activeDocument;
// インストールされている書体のリストを取得する関数
function getInstalledFonts() {
var fontList = [];
var fonts = app.textFonts;
for (var i = 0; i < fonts.length; i++) {
fontList.push(fonts[i].name);
}
return fontList;
}
var fontAll = getInstalledFonts();
// ダイアログボックスの作成
var dialog = new Window("dialog", "縦組テキストを配置", undefined, {resizeable: true});
dialog.orientation = "column";
// ダイアログボックスに「テキスト入力エリア」を追加
var textArea = dialog.add("edittext", undefined, "", {multiline:true, scrolling:true});
textArea.preferredSize = [500, 200]; // 幅500、高さ200
// ダイアログボックスに「書体の選択」の追加
var fontDropdown = dialog.add("dropdownlist", undefined, fontAll, {scrolling:true}); // インストールされている書体のリストを取得
fontDropdown.selection =…1 vote -
Email newsletter for third-party developers
Could Adobe please offer an email newsletter updating third-party plugin developers of changes that may affect or even break their plugins? It's helpful that there is a "known issues" web page, which may or may not identify problems known only to Adobe, but rather than every small developer checking this page every day, perhaps someone at Adobe could send one message to all subscribed developers. Too often, changes quietly happen and developers must scramble to help each other.
One recent example is AI 28.1 corrupting some 28.0 preference files, and a major example would be when Mac AI 25.1 required…
6 votes -
Control the angle, length of gradients and other
ExtendScript does not allow you to control the length, angle, or other parameters of gradients. These are all read-only attributes. Script authors can only work with color stops.
For example, to rotate a gradient, we have to use the rotate() method, which has another problem. The angle of such a gradient is not copied to another object with the Eyedropper Tool: https://medium.com/@aiscripts/gradient-rotation-bug-24d7a6f6038f
The fillColor assignment commands (selection[1].fillColor = selection[0].fillColor) carry over the base gradient, losing other properties. This reduces the ability to automate gradients via ExtendScript.
Also ignores other Uservoices:
1) https://illustrator.uservoice.com/forums/908050-illustrator-desktop-sdk-scripting-issues/suggestions/44461230-adjusting-one-gradient-causes-changes-to-unrelated
2) https://illustrator.uservoice.com/forums/908050-illustrator-desktop-sdk-scripting-issues/suggestions/40296880-erroneous-fillcolor-type-one-shapes-with-freeform
3) https://illustrator.uservoice.com/forums/333657-illustrator-desktop-feature-requests/suggestions/38435974-gradient-swatch-includes-angle-and-position-pleas6 votes -
Install new tools in toolbox by default
When a user adds a new third-party plugin, its tools should be added to the toolbox, where users expect to find it, rather than hidden in the drawer, which many users don't even know about. Hiding new tools creates frustration for users and extra support hassle for developers.
6 votes -
Vertically alignChildren in ScriptUI does not align properly
In the ScriptUI documentation, there is an alignChildren attribute: "Tells the layout manager how to align children of this container that are not of the same size in a column or row". The issue of vertical alignment of UI objects in the scripts dialog box persists from version to version of Illustrator.
As we can see in the image, only the top alignment seems to be correct. The center alignment is shifted up, and the bottom alignment does not reach the bottom. At the same time, native UI dialogs contain the correct alignment. Thus script interfaces always look less professional.
…
3 votes -
check a keyboard key state in SDK
I often need a way to check if a specific keyboard key is currently pressed. For example, while a tool is being dragged, allow users to press the 'W' or 'E' key as they would a modifier like Shift or Alt/Option.
3 votes -
Change Adobe PDF settings without creating a PDF file
Does anyone know if there is a way to change Adobe PDF settings without saving the current file into a PDF file? More specifically, is there a way to turn on/off the "Preserve Illustrator Editing Capabilities" option using C++ SDK?
1 vote -
weird unicode file names in CEP panel scripts
Files with unicode names should report correctly in the documentAfterActivate and documentAfterSave events.
I just noticed that there are not only strange sequences of escaped and unescaped characters, but they can even differt between these two events.
A € sign produces 0x80 in the activate event and %e2 0x82 %ac in the save event1 vote
- Don't see your idea?