Set active shape key using Python
Hi here is some quick code from the python console,

I have an active object with a number of shapekeys, "Key 1" being one, I find the index using find(...) then set the active_shape_key_index to this number.  

find(...) will return -1 if a key of that name is not found.

&gt;&gt;&gt; index = C.object.data.shape_keys.key_blocks.find('Key 1')
&gt;&gt;&gt; index
1

&gt;&gt;&gt; C.object.active_shape_key_index = index
&gt;&gt;&gt;