Place object from Library than scale
Dear people,
I'm trying to build a script that’s placing an object (in a text frame) and than scale the object to xx%.
The script place the object but it is not being scaled, any idea why?
var setting;
setting = app.transformPreferences.whenScaling;
app.transformPreferences.whenScaling = WhenScalingOptions.ADJUST_SCALING_PERCENTAGE;
t=app.libraries.item("test.indl").
assets.item("item1").
placeAsset(app.activeDocument);
allSel = app.libraries.item
; if (allSel.length > 0) {
xScale = 60 / 100;
yScale = 60 / 100;
for (t=0; t<app.selection.length; t++) {
app.libraries.item
.horizontalScale = app.libraries.item .horizontalScale * xScale; app.libraries.item
.verticalScale = app.libraries.item .verticalScale * yScale; }
}
Thanks for anyone who wants to help!
Greetings from Holland