Copy link to clipboard
Copied
Hi
I have an indesign document that contain 1000 pages from data merge process ...each page consists of background image and and image in circle graphic frame .
Now Please I want a 2 scripts
1- One that delets all pages that contain empty graphic frame ( has No images in its graphic frame )
2- Second that delets all pages that contain graphic frame ( has images in its graphic frame )
Thanks For your help in advance
Use my second script. It removes pages with graphics in the oval. Remove the /* and */ to do the viceversa. This assumes only one oval per page.
var ps = app.activeDocument.pages;
var i = ps.length;
while(i--) {
if (/*!*/ps[i].ovals[0].graphics.length) {
ps[i].remove();
}
}
Copy link to clipboard
Copied
Do you want to remove pages that have no graphics at all? Or just if the ovals have no graphics? This removes all pages with graphics. Remove the /* and */ to remove all pages without graphics.
var ps = app.activeDocument.pages;
var i = pages.length;
while(i--) {
if (/*!*/ps[i].allGraphics.length) {
ps[i].remove();
}
}
If you only want to remove based on oval layout, then same concept using the following, assuming only one oval per page:
var ps = app.activeDocument.pages;
var i = pages.length;
while(i--) {
if (/*!*/ps[i].ovals[0].graphics.length) {
ps[i].remove();
}
}
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Use my second script. It removes pages with graphics in the oval. Remove the /* and */ to do the viceversa. This assumes only one oval per page.
var ps = app.activeDocument.pages;
var i = ps.length;
while(i--) {
if (/*!*/ps[i].ovals[0].graphics.length) {
ps[i].remove();
}
}
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Ooops, just edited above. pages.length should have been ps.length
Copy link to clipboard
Copied
Very Great thanks For You
2 Scripts Work like charm
Thaaaanks Alot
Copy link to clipboard
Copied
Any Help
Find more inspiration, events, and resources on the new Adobe Community
Explore Now