Copy link to clipboard
Copied
Hi community,
I want to push page number in a list wherever a linked image appears but don't understand why list is a wrong sequence.
Could you help me? thanx in advance.
Mario
Probably because of spreads and how the graphics on the page are read. You could do this instead, especially if you just want one page number in the array.
var pages = app.activeDocument.pages.everyItem().getElements();
var pagesWithGraphics = [];
for (var i = 0; i < pages.length; i++) {
if (pages[i].allGraphics.length > 0) {
pagesWithGraphics.push(pages[i].name);
}
}
Copy link to clipboard
Copied
Probably because of spreads and how the graphics on the page are read. You could do this instead, especially if you just want one page number in the array.
var pages = app.activeDocument.pages.everyItem().getElements();
var pagesWithGraphics = [];
for (var i = 0; i < pages.length; i++) {
if (pages[i].allGraphics.length > 0) {
pagesWithGraphics.push(pages[i].name);
}
}
Copy link to clipboard
Copied
Hi Brian,
this helped me and one page number is a better solution too.
thanx a lot
Mario