# create a dummy stringArray plug
sph = cmds.polySphere(ch=0)[0]cmds.addAttr(sph, ln='foo', dt='stringArray')strplug = '.'.join((sph, 'foo'))
# get the function setsel=MGlobal.getSelectionListByName(strplug)hPlug=sel.getPlug(0).asMDataHandle()fn=MFnStringArrayData(hPlug.data())
# fail to do anything with it.... also, noticed that by default it seems to error instead of returning an empty array..fn.set('bar')
plug = MGlobal.getSelectionListByName('node.attr').getPlug(0)dummy = MFnStringArrayData().create(['foo', 'bar'])plug.setMObject(dummy)