Copy link to clipboard
Copied
I need a script which detects text frames which exceed a 10mm page margin.
I'd like these frames to automatically be set to the edge of the margin at 10mm.
var frames = app.activeDocument.textFrames.everyItem().getElements();
var marg = app.activeDocument.pages.everyItem().marginPreferences;
for (i=0;i<frames.length;i++){
if (frames.geometricBounds>marg){
frames.geometricBounds=marg;
}
}
Am I on the right track with this script?
1 Correct answer
Hi jakec88782761
geometricBound is an array itself. The entries in the array are (y1, x1, y2, x2). Yes the array starts with y not x, historical reasons.
Wo what you want to test is … geometricBounds[1] …
kind regards
Daniel (from Switzerland)
Copy link to clipboard
Copied
I really only need the left hand side of the frame to not exceed the left hand margin
Copy link to clipboard
Copied
Hi jakec88782761
geometricBound is an array itself. The entries in the array are (y1, x1, y2, x2). Yes the array starts with y not x, historical reasons.
Wo what you want to test is … geometricBounds[1] …
kind regards
Daniel (from Switzerland)

