Pulled from Configurator 4's template jsx:
function getToolCharStringID(indescIDFromSWF)
{
try {
//convert the string from SWF to a number
var id = Number(indescIDFromSWF);
$.writeln("id:" + id);
var desc = new ActionDescriptor();
desc.fromID(id);
var idNull = charIDToTypeID('null');
var ref = desc.getReference(idNull);
var toolID = ref.getDesiredClass();
$.writeln("toolID:" + toolID);
//use this to compare against spotHealingBrushTool
var stringID = typeIDToStringID(toolID);
$.writeln("stringID:" + stringID);
//use this to compare against other tool codes
var charID = typeIDToCharID(toolID);
$.writeln("charID:" + charID);
return (charID!=null && charID.length > 0) ? charID : stringID;;
}catch(err){
$.writeln ("error:" + err);
}
}
It worked for me. I haven't dissected it to see why it worked where others didn't, but the important thing is that it worked.
Sam