Editor scripts: Setting selected game objects

Hi,

I’m wondering if there is any way to write editor script code that instructs unity to select multiple game objects in the 3d view and object hierarchy.

I know there is Selection.activeGameObject which allows to set a single object as the currently selected one.

There is also Selection.gameObjects which allows to retrieve the list of all selected objects. Unfortunately this variable is read-only so one cannot set multiple gameobjects.

Is there any way to do this? I know I could put my objects into a parent object, but this isn’t really a good solution for my purpose.

Selection.objects should definitely be writable.