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

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

120

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 Expert ,
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

Votes

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

Votes

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