Script to Draw a Box relative to Two Other Objects
Test 1 Image shows what I want my result to be.
Test 3 Image shows my starting point.
I am looking to draw a rectangle that aligns with the top and left edge of a Black Box and extends 1/8" to the right and bottom of White text. I've mostly worked with VBScripting in Corel and Illustrator feels like a different beast with the way it handles Paths vs Corel's shapes.
An issue I have is that the White object may sometimes be Text, Paths or a combination of both. I would like to iterate across all block boxes on one page, creating the blue box on each one. A page may contain hundreds of these boxes.
I'm assuming I need to first find all black boxes then loop through them, finding overlapping white objects. Use a combination of their bounding boxes to create the blue box. It feels like it should be simple however I am stuck trying to find the overlapping white objects.
Any help selecting an object by both color and within a specific bounding box would be appreciated.

