How can I make my custom board use the programmer selected in "Tools->Programmer" when the Upload button is pushed? I've created a custom board that can be programmed using any one of several programmers defined in programmers.txt. I would like the user to be able to choose which programmer to use via the "Tools->Programmer" menu options. 

I tried using {protocol} and {upload.protocol} in platform.txt to pass the programmer to the upload tool, but neither seem to be defined when the Upload button is used to initiate the upload (they are defined if Upload using programmer is selected from the menu).
Make sure you do not have a protocol listed in the boards.txt file. If the uploader sees protocol is null then it will fall back to using the same code that "Upload using programmer" does. 

Relevant code in SerialUploader.java:

    if (usingProgrammer || prefs.get("upload.protocol") == null) {
      return uploadUsingProgrammer(buildPath, className);
    }