Reply To: Resize graphic frames with an Object style applied

#61139
Anonymous
Inactive

Hi Kasyan

Thanks again for sorting this – I had it working, but now when I run it it seems to do nothing – code below. Any thoughts at all? All help appreciated. Running InDesign CS3.

Mike

Main();

function Main() {
var frame, gb, gb_new;
if (app.documents.length > 0) {
var doc = app.activeDocument;
var objStyle = doc.objectStyles.item(“Review Pic Box Stroked”);
if (objStyle != null) {
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]+39.25, gb[1]+24 ];
frame.geometricBounds = gb_new;
}
}
else {
alert(“Object style “Review Pic Box Stroked” doesn't exist”);
}
}
else {
alert(“No open documents.”);
}
}

This article was last modified on November 23, 2011

Comments (0)

Loading comments...