Scripting the Trim command -- programmatically select objects to keep or remove?

 From:  mike (MVERHULST)
11415.8 In reply to 11415.7 
excellent,

thanks for your help :)

i needed to add

var objects = gd.getObjects();
objects.unlockSelection();