How to select and copy paths in the bounding box?

How to select and copy paths in the bounding box through script?

You mean that all those shapes are in one layer? You iterate all nodes of all paths and collect all the paths that are inside that rect.

PS: we know the bounds’s size and position in advance.
Thanks.

Yes, could you help give some sample script ? Please

I just remembered that the paths have a bounds method:
So you could do something like this:

from Foundation import NSMakeRect, NSIntersectsRect
checkRect = NSMakeRect(-10, -100, 200, 200)
for p in Layer.paths:
	if NSIntersectsRect(checkRect, p.bounds):
		print(p)

Great, thanks.