Copy link to clipboard
Copied
The following allows gets the file paths of all pageItems where item.hasOwnProperty("graphics")
However, this does not get the file paths for the frames that are within a group on that page.
How can we resolve this? Any suggestions or insight would be appreciated. Thank you.
var doc = app.activeDocument;
var viewportBounds = app.activeWindow.activePage.bounds;
var viewportElements = app.activeWindow.activePage.getElements(viewportBounds);
var filePaths = [];
var modifiedFilePaths = [];
var page = app.activeWindow.activePage;
for (var i = 0; i < page.pageItems.length; i++) {
var item = page.pageItems[i];
if (item.hasOwnProperty("graphics")) {
for (var j = 0; j < item.graphics.length; j++) {
var graphic = item.graphics[j];
var filePath = graphic.itemLink.filePath;
// check if file path is already in the array
if(!filePaths[filePath]) {
filePaths[filePath] = true;
Iterate through page.allPageItems instead of just page.pageItems;
The alternative is to write your own recursive func, but that's what allPageItems is for.
Copy link to clipboard
Copied
Iterate through page.allPageItems instead of just page.pageItems;
The alternative is to write your own recursive func, but that's what allPageItems is for.
Copy link to clipboard
Copied
Hi @SnowDPD , Another option might be to loop through the links and check the linked graphic’s parentPage:
var lnks = app.activeDocument.links;
var ap = app.activeWindow.activePage;
for (var i = 0; i < lnks.length; i++){
if (lnks[i].parent.parentPage == ap && lnks[i].parent.hasOwnProperty("graphics")) {
$.writeln(lnks[i].filePath)
}
};
Copy link to clipboard
Copied
Open links panel, add filepath column, set shortcut for: get all information from links panel. Done.
#miNerikejZeToNejde
Copy link to clipboard
Copied
Hi together,
how about using this array:
page.allGraphics
Of course you have to check for property itemLink, because with copy/pasted graphics from e.g.an open PhotoShop image selected this should throw an error.
Regards,
Uwe Laubender
( Adobe Community Expert )