Don’t litter in layers

The script added a lot of objects
var newGroup = addGroup('MARKERS');for (var i = 0; i < selection.length; i++) {
selection[i].move(newGroup, ElementPlacement.PLACEATBEGINNING);
}
function addGroup(name) {
var lblGroup;
try {
lblGroup = activeDocument.groupItems.getByName(name);
} catch (e) {
lblGroup = activeDocument.activeLayer.groupItems.add();
lblGroup.name = name;
}
return lblGroup;
}
In my NumeratesPoints script, markers and numbers are added to separate groups

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store