I think you are almost there except that you have used assignment operator which will return TRUE always. Instead you have to use comparison '==' or '===' operators. update in below line EnabledScript="javascript:SP.ListOperation.Selection.getSelectedItems().length === 1;"