Copy link to clipboard
Copied
Hi,
How to get links scaling X-value and Y-Value in illustator using javascript.
Thanks
Hi, here's an example of getting scale and rotation of linked (or embedded) item:
var item = app.activeDocument.selection[0];
if (item.typename == 'PlacedItem' || item.typename == 'RasterItem') {
var m = item.matrix;
var rotatedAmount = asDegrees(Math.atan2(m.mValueB, m.mValueA));
//rotation goes the other way for placed items!
if (item.typename == 'PlacedItem') rotatedAmount = -rotatedAmount;
var scaledAmount = [m.mValueA * 100, m.mValueD * 100];
alert(item.typename
...
Copy link to clipboard
Copied
Hi, here's an example of getting scale and rotation of linked (or embedded) item:
var item = app.activeDocument.selection[0];
if (item.typename == 'PlacedItem' || item.typename == 'RasterItem') {
var m = item.matrix;
var rotatedAmount = asDegrees(Math.atan2(m.mValueB, m.mValueA));
//rotation goes the other way for placed items!
if (item.typename == 'PlacedItem') rotatedAmount = -rotatedAmount;
var scaledAmount = [m.mValueA * 100, m.mValueD * 100];
alert(item.typename
+ '\nscaleX = ' + scaledAmount[0]
+ '\nscaleY = ' + scaledAmount[1]
+ '\nrotation = ' + rotatedAmount
);
}
function asDegrees(radians) { return radians * 57.2957795 }
Copy link to clipboard
Copied
Hello! m1b Check if there is a zoom in the connection diagram, and if there is a zoomed-in or enlarged link diagram, select it. How to script this? Thank you
Copy link to clipboard
Copied
No quite sure yet what you mean. You want script to select a linked image (PlacedItem) that has a scale greater than 100?