Invert selection - script please

I want to select all the objects by ignoring the active selection, that too this happened 
within the active group selection and not normal outside.  this script is for active group

selection.

By holding the Control Key, i made a selection, now i run the script, now i want the invert

selection within that group only