rem: if (gAbView && gAbView.selection) 
add: var enabled = false; if (gAbView && gAbView.selection) { if (gAbView.directory) enabled = gAbView.directory.operations & gAbView.directory.opWrite; 
context:   isCommandEnabled: function(command)  {    switch (command) {      case "cmd_selectAll":        return true;      case "cmd_delete":      case "button_delete":        var numSelected;        if (gAbView && gAbView.selection)          numSelected = gAbView.selection.count;        else           numSelected = 0;        // fix me, don't update on isCommandEnabled        if (command == "cmd_delete") {          if (numSelected < 2)            goSetMenuValue(command, "valueCard");          else            goSetMenuValue(command, "valueCards");        }        return (numSelected > 0);      case "button_edit":        return (GetSelectedCardIndex() != -1);      default:        return false;    }  },
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/3c8e4f602fde51e5177fad98b84e98ab285e00a3/abCommon.js/buggy/mailnews/addrbook/resources/content/abCommon.js