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

in JS, what is the itemKey parameter for index(itemKey)? and how am i suppose to know it?

Enthusiast ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

almost every collection in illustrator seems to have the method index(itemKey) that gets an element from the collection with itemKey being 'string, number'

 

but what is that string and number? how do i find what the "itemKey" of an object is? it's not something i can assign, so when does one use this method without knowing what the itemKey is?

TOPICS
Scripting

Views

328

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

correct answers 1 Correct answer

Adobe
Guide ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

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
Enthusiast ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

Where's this information coming from? When I iterate through the keys of collections like PathItems or PageItems, there's no index key or method.

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
Guide ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

It's in the JS Scripting Reference (including the most recent one). 

 

Untitled1.png

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
Enthusiast ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

LATEST

Odd, I get undefined trying to explicitly call it. Not sure why there'd be a method for it in the first place instead of using bracket notation though.

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