Ok, I got it to work:
var doc = app.activeDocument;
doc.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;
doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.MILLIMETERS;
doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.MILLIMETERS;
var tFrames = doc.pages[0].textFrames;
for (var n = tFrames.length-1; n >= 0 ; n--)
{
var gb = tFrames.geometricBounds;
var w = gb[3]-gb[1];
var h = gb[2]-gb[0];
if (h == 20 && w == 20 )
{ tFrames.remove(); }
}
Now I have to look how to loop through pages.
thx.
Martin
Keep in mind what I wrote about rounding errors, but here's the idea:
function removePageFrames(page){
var tFrames = page.textFrames;
for (var n = tFrames.length-1; n >= 0 ; n--){
var gb = tFrames.geometricBounds;
var w = gb[3]-gb[1];
var h = gb[2]-gb[0];
if (h == 20 && w == 20 ){
tFrames.remove();
}
}
}
for(var i=0;i<doc.pages.length;i++){
removePageFrames(doc.pages);
}