Skip to main content
Inspiring
July 23, 2021
解決済み

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

  • July 23, 2021
  • 返信数 2.
  • 726 ビュー

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?

このトピックへの返信は締め切られました。

返信数 2

Inventsable
Legend
July 23, 2021

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.

femkeblanco
Legend
July 23, 2021

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

 

Inventsable
Legend
July 23, 2021

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.