Test for availability of a user command?

I would like to determine if a specific user defined command (e.g. another script, external to the launching script) exists and act accordingly rather than assume that it does. Is there a way of doing this from within a script? Pseudo code:

var cmd = ScriptCommandData.func.command;
if Usercommand.exists("MyCmd") cmd.runcommand("DOpusRT /cmd MyCmd");

CommandList() is what you're looking for.

Thanks @errante. How did I miss that? :flushed: