var allCharacters = findObjs({_type: "character"});
for(var c in allCharacters) {
var currentCharacter = allCharacters[c];
if (currentCharacter.get("name") == msgApiCommand){
var spokenByid = currentCharacter.get("controlledby");
};
}; Try: var spokenByIds = findObjs({ _type: "character", name: msgApiCommand })[0].get("controlledby").split(","); spokenByIds is now an array of player IDs, or the string "all". You can take action on all of them by iterating over the array: _.each(spokenByIds, function(id) { if (id == "all") { // do something with all players } else { var player = getObj("player", id); // do something with player } });