Skip to main content
Muhammad_eloc
Known Participant
December 30, 2014
Answered

transform > reflect objects in illustrator via javascript

  • December 30, 2014
  • 2 replies
  • 1654 views

Hi all,

are there any way to transform > reflect Vertical axis in illustrator but via JavaScript not apple and i mean reflect not scale H or V

thanks in advance.

This topic has been closed for replies.
Correct answer pixxxelschubser

Hi Muhammad.eloc,

you can try something like this:

var totalMatrix = app.getScaleMatrix(-100,100);

app.activeDocument.activeLayer.pathItems[0].transform(totalMatrix);

e.g. for the first path item in the active layer

Have fun

2 replies

Participant
October 26, 2023

var totalMatrix = app.getScaleMatrix(-100, 100); // Create the scale matrix

 

var layer = app.activeDocument.activeLayer; // Get the active layer

 

for (var i = 0; i < layer.pageItems.length; i++) {
        // Iterate through all items in the layer
        var currentItem = layer.pageItems[i];

 

        // Check if the item's name is "verso" before applying the scale matrix
        if (currentItem.name === "verso") {
                currentItem.transform(totalMatrix);
        }
}

But u got change the name of the object to "verso" and the layers to "Camada 1"

pixxxelschubser
Community Expert
pixxxelschubserCommunity ExpertCorrect answer
Community Expert
December 30, 2014

Hi Muhammad.eloc,

you can try something like this:

var totalMatrix = app.getScaleMatrix(-100,100);

app.activeDocument.activeLayer.pathItems[0].transform(totalMatrix);

e.g. for the first path item in the active layer

Have fun

Inspiring
February 3, 2016

Pixxxel Schubser's answer should be marked as the correct answer