Reply To: Resize graphic frames with an Object style applied

#60615

Oops! My fingers work faster than my brain. Unfortunately I can't edit the post!

Here's a new version:

Main();

function Main() {
var frame, gb, gb_new;
if (app.documents.length > 0) {
var doc = app.activeDocument;
var objStyle = doc.objectStyles.item(“CarImage”);
if (objStyle.isValid) {
doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.MILLIMETERS;
doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.MILLIMETERS;

var objPref = app.findObjectPreferences;
objPref.appliedObjectStyles = objStyle;
var found = doc.findObject();

for (var i = 0; i < found.length; i++) {
frame = found[i];
gb = frame.geometricBounds;
gb_new = [ gb[0], gb[1], gb[0]+13, gb[1]+26 ];
frame.geometricBounds = gb_new;
}
}
else {
alert(“Object style “CarImage” doesn't exist”);
}
}
else {
alert(“No open documents.”);
}
}

This article was last modified on September 27, 2011

Comments (0)

Loading comments...