Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Community Beginner ,
Oct 27, 2021 Oct 27, 2021

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
196
Translate
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 Expert ,
Oct 27, 2021 Oct 27, 2021

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

Translate
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
LATEST

Dear Manan,

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

  • Your time & talents are valued & appreciated!  

With thanks!

Plane Wryter

Translate
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