What’s an idomatic way for my omnijs plugin to build an array of all selected items and their descendants?
Right now, I’m doing something ugly and inefficient:
I iterate through all selected items, pushing each and all of its descendants into a new array, then dispose of all the duplicates in the new array when I’m done.
My way works, but there’s got to be a tidy way to do this that’s escaping me.
And to be clear, I don’t want to force the application to visibly expand anything–I just want the data.
Does anyone have a way?