This site aims to be the ultimate resource for Adobe Illustrator(c) scripting. Here you will find regularly updated collection of scripts for all your creative needs.
If you find yourself doing the same task again and again, or you have an idea how to optimise your  workflow – get in touch, and we will provide solution.

Group overlapping

groupOverlappingObjects.js

Group all overlapping objects in the selection into separate groups. The definition of “overlap” is based on the object’s bounding box, not the actual geometry. The new group’s order is determined by the depth of the frontmost object in each group. Unlimited number of groups created. Any non-duplicate objects are ignored.