| User | Post |
|
6:47 am September 21, 2011
| David Blatner
| | | |
| Admin
| posts 823 |
|
|
This isn't exactly the same, but check out the tomaxxiResizeEach script:
http://tomaxxi.com/downloads/
|
co-host, InDesignSecrets.com
|
|
|
4:20 am September 27, 2011
| Kasyan Servetsky
| | Kiev, Ukraine | |
| Member | posts 65 |
|
|
Main();
function Main() { 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."); } }
|
|
|
4:21 am September 27, 2011
| Kasyan Servetsky
| | Kiev, Ukraine | |
| Member | posts 65 |
|
|
Forgot to add var in the following lines:
var frame = found[i]; var gb = frame.geometricBounds; var gb_new = [ gb[0], gb[1], gb[0]+13, gb[1]+26 ];
|
|
|
4:25 am September 27, 2011
| Kasyan Servetsky
| | Kiev, Ukraine | |
| Member | posts 65 |
|
|
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."); } }
|
|
|
9:04 am September 27, 2011
| David Blatner
| | | |
| Admin
| posts 823 |
|
|
Thanks, Kasyan! Cool. Sorry… we are working on a new forum and site software, and one of the things we will definitely try to do is allow people to edit their own posts!
|
co-host, InDesignSecrets.com
|
|
|
10:42 am September 27, 2011
| Kasyan Servetsky
| | Kiev, Ukraine | |
| Member | posts 65 |
|
|
Hi Dave,
I have a suggestion: the new forum software should provide for possibility to post code. In the code I posted, backslashes have been removed before the quotes surrounding the CarImage in the line 24, which will result in error in case the object style doesn't exist in the document.
The line should have been be like so:
alert("Object style [backslash]"CarImage[backslash]" doesn't exist");
Formerly I tried to enclose the code in
tag in the HTML source editor, but this didn't help.
Regards, Kasyan
|
|
|
8:01 am September 28, 2011
| Kasyan Servetsky
| | Kiev, Ukraine | |
| Member | posts 65 |
|
|
Hi Mike,
What version of InDesign are you on? I guess you're on CS3.
It's always a good idea to specify the InDesign version and the platform — Mac or PC — for which you want the script.
Let's try to replace
if (objStyle.isValid) {
with
if (objStyle != null) {
to make it compatible with CS3.
Regards, Kasyan
|
|
|
10:31 am September 30, 2011
| Chuckie
| | Bainbridge Island, WA | |
| Member | posts 37 |
|
|
This is a pretty good thread. And another reason why — maybe with our new ID Secrets website coming — we should have an ID wishlist portal.
Because if Adobe's listening here … Object Styles should also contain geometry that include X,Y position, proxy & X,Y proportion, maybe even scaling percentage would be nice.
Talk about efficiency. This is a cross-court winner. Obj Styles could contain it, but even BETTER would be Object Tags in which values relating to print & digital media are tagged & controlled by the text frame attributes themselves.
As InDesign begins to merge print with digital platform export, there are huge advantages here.
2 cents …
|
|
|
12:04 am November 24, 2011
| Kasyan Servetsky
| | Kiev, Ukraine | |
| Member | posts 65 |
|
|
Hi Mike,
Try to add this line:
app.findChangeObjectOptions.objectType = ObjectTypes.GRAPHIC_FRAMES_TYPE;
It corresponds to the "Type: Graphic Frame" option in the "Object" tab of the "Fing/Change" dialog box. Most probably it is set to a wrong type e.g. "Text Frame" at the moment and the script finds nothing.
Hope this helps.
Kasyan
|
|
|
7:11 am April 25, 2012
| Chuckie
| | Bainbridge Island, WA | |
| Member | posts 37 |
|
|
A twist down memory lane on this.
Can this script be modified to specify layer and scale the layer's elements by percentage?
|
|