That's for Rules, not custom build commands.
The situation I'm in is I've got a project with a bunch of xml files which need to be built with a custom tool. However, the files are in three directories, each directory needing a different tool. I can set up a rule which operates on xml files, but I can't find a way to apply a rule only to files in a certain directory (or do different build commands depending on which directory they're in).
The only way to do this with rules that I can think of, is to create three rules, three projects, and divide the work up that way, but I'd really rather have them all in one project if I can.