Thanks for the input! The solution did seem hacky, but I couldn't think of anything else that would work outside of writing a script. I guess I'll just use a host family to do the picking.
Unfortunately, I can't really use objects2 to loop since the snippet is a part of a larger function, but as a standalone it does look better.
I did, however, like your approach to the comma solution so I'm yoinking that! Very neat indeed.