Please allow scripts to set or read the key object to perform align and other operations
Hi, I am a plugin developer, and there is a lot of features we are missing in Illustrator scripting that can be done manually in Illustrator. This is the one feature. Please add this feature so that we have some method or property to make the object as a key object to perform "Align to Key Object" operation via script.
-
A rather clever solution to detect a keyed object was mentioned here: https://note.com/mute_racoon3631/n/n5dfae854988a — the script sizes all the objects in a selection to match the key one (the function was requested here: https://illustrator.uservoice.com/forums/333657/suggestions/35740054).
What the script does to detect a key is performing several aligning operation to see which of the objects doesn’t move (and undo these steps). It’s rather inventive and I clap.
For some reason it refused to work for me on Windows, but for some other users it does (on both Windows and Mac)... Ah, I see — it works when called from File > Script, or when dropped into the window’s caption, but dropping it onto canvas doesn’t work properly.
-
Kazem Rahimi commented
This is a very useful feature and I am in problem with it too.
please add it. -
Beau Gilles commented
This would be great to have, the key object selection would be very useful for many illustrator macros.
-
Jeremy commented
Please add a read/write property to selected objects for the current key object in a selection.
e.g.:
app.activeDocument.selection.keyObjectIndex = 3;
or
app.activeDocument.selection[3].isKeyObject = true;
etc...
-
Ai allows to set a key object, but does not allow scripts to utilize this.
Please give us a way to grasp on it.
An ability to mark one object in a selection can do so much more than it seems! -
Ed
commented
Could you please at least add something to determine if the selected object is the Key Object.
-
Raphaël
commented
I agree, I am very limited because of this missing feature.
-
InDesign has selectionKeyObject. Why Ai can’t have one?
-
Charu
commented
Hi, I am a plugin developer, and there is a lot of features we are missing in Illustrator scripting that can be done manually in Illustrator. This is the one feature. Please add this feature so that we have some method or property to make the object as a key object to perform "Align to Key Object" operation via script.