Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


How Select All Photo Images into a Javascript Variable Suitable for Iteration Over the Collection?

Community Beginner ,
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

Views

53

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 28, 2021 Oct 28, 2021

Copy link to clipboard

Copied

LATEST

Dear Manan,

Many, many thanks for your helpful reply to my request.

  • Your time & talents are valued & appreciated!  

With thanks!

Plane Wryter

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines