Close Component Option & Component Attribute windows using ruby script

Thanks DanRathbun. I’m not writing a plugin, I’m using a script that Eneroth3 posted to select all child instances. It’s a work around for an issue discussed here:

Aerillus, I agree the script is not strictly safe but it solves my problem until Trimble rectify the issue. If the component option and component attribute windows are accidentally left open it throws up an alert “Merging multiple items might be slow. Do you want to continue”. This requires each instance to be either OK’d or cancelled, in the case of my drawings too many times. I tend to force quit at this point.

I was hoping to add a few lines to the script to force these windows shut if they are left open. I’m not sure if this is possible with what you have very kindly posted DanRathbun but that is the aim.

Many thanks