What is the best way to deal with array-like, but not true Array collections in Illustrator
See original GitHub issueI would like to use the forEach()
function on app.activeDocument.pageItems
, but it is not a proper Array. I tried to get around this by using Array.from(app.activeDocument.pageItems)
, but this does not appear to be an available function. I was successful using [].concat(app.activeDocument.pageItems)
. Is this the most efficient way to make pageItems into an Array? Is there a way to use forEach() with the non-Array, but array like collections in Illustrator?
Perhaps there should be a warning about these array like collections in the readme.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Solved: Misleading scripting guide? PathPoints index - 7387469
Solved: Hello, I've had trouble finding how to access the PathPoint positions today. Apparently, the correct way to do it is by writing...
Read more >Best way to create an array of objects in Illustrator? - Super User
Go to Effects -> Distort/Trasnform -> Transform... Add amount of copies you want then play with the array controls.
Read more >What causes a java.lang.ArrayIndexOutOfBoundsException ...
The only place this should change value is to keep the loop going. Changing it otherwise is just risking an exception, and is...
Read more >1. Introduction to Groovy - Programming Grails [Book] - O'Reilly
But Groovy extends this in convenient ways. null object references evaluate to false . Nonempty collections, arrays, and maps; iterators and enumerations with ......
Read more >Underscore.js
Note: Collection functions work on arrays, objects, and array-like objects ... or passing false or Infinity, flattens the array all the way to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe that babel upstream may be the better avenue for getting a solution. Thanks for looking into this.
You could fork extendscriptr and modify your fork as you like