0
How Select All Photo Images into a Javascript Variable Suitable for Iteration Over the Collection?
Community Beginner
,
/t5/illustrator-discussions/how-select-all-photo-images-into-a-javascript-variable-suitable-for-iteration-over-the-collection/td-p/12478080
Oct 27, 2021
Oct 27, 2021
Copy link to clipboard
Copied
In Javascript, how can all photo images contained in an Illustator .AI file--regardless of whether they are on an Artboard or scattered around the Canvas--be programmatically selected and included in a JS variable suitable for iterating over the entire collection?
- A code snippet would be MOST APPRECIATED!
Many thanks in advance!
Plane Wryter
TOPICS
Scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explore related tutorials & articles
Community Expert
,
/t5/illustrator-discussions/how-select-all-photo-images-into-a-javascript-variable-suitable-for-iteration-over-the-collection/m-p/12478635#M296101
Oct 27, 2021
Oct 27, 2021
Copy link to clipboard
Copied
Try the following, it will alert the filepath of each placeditem in the currently active AI file
var pi = app.documents[0].placedItems
for(var i = 0; i < pi.length; i++)
{
alert(pi[i].file)
}
-Manan
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Plane Wryter
AUTHOR
Community Beginner
,
LATEST
/t5/illustrator-discussions/how-select-all-photo-images-into-a-javascript-variable-suitable-for-iteration-over-the-collection/m-p/12479875#M296171
Oct 28, 2021
Oct 28, 2021
Copy link to clipboard
Copied
Dear Manan,
Many, many thanks for your helpful reply to my request.
- Your time & talents are valued & appreciated!
With thanks!
Plane Wryter
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

