🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #709

CS3 JS flag which page has empty frame

#709
From: John_Kordas
Date: Tue, 17 Mar 2009 13:17
24 lines
1379 bytes
I am trying to put together a script that will detect pages that have 2 types of elements.

1. blank graphic frames
2. graphic frames with images larger than the frame holding it.

I've created a simple 5 page doc and placed images on page 1 and 3. So the frist step is can I flag that page 1 and 3 have image on them.

This is what I have so far

var myDoc = app.activeDocument;
var myPages = myDoc.pages;
var myRecs = myDoc.rectangles;

for (var j = myPages.length - 1; j >= 0; j--) {
	if(myPages[j].rectangles.length >= 1){
	$.writeln("page "+j+" has a frame.");
	}
}

And it returns the following in the console which is correct.
page 2 has a frame.
page 0 has a frame.

Is there a way to check if the frame has an image and if it image fits the frame or not?
Technical Details
Message-ID: <59b83b3d.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!news2.glorb.com!newsfeed.news2me.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,5f85c25f887dafb2,start
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: John_Kordas@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!news2.glorb.com!newsfeed.news2me.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: CS3 JS flag which page has empty frame
Message-ID: <59b83b3d.-1@webcrossing.la2eafNXanI>
Date: Tue, 17 Mar 2009 06:17:57 -0700
Lines: 27
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit