public void runMacro(String name, Editor editor) {
   if (anonymousName != null && name.equals(anonymousName)) {
     ImageJ.setCommandName(name);
     new MacroRunner(pgm, 0, anonymousName, editor);
     return;
   }
   for (int i = 0; i < nMacros; i++)
     if (name.equals(macroNames[i])) {
       ImageJ.setCommandName(name);
       new MacroRunner(pgm, macroStarts[i], name, editor);
       return;
     }
 }
 public void actionPerformed(ActionEvent evt) {
   String cmd = evt.getActionCommand();
   ImageJ.setCommandName(cmd);
   MenuItem item = (MenuItem) evt.getSource();
   MenuContainer parent = item.getParent();
   if (parent instanceof PopupMenu) {
     for (int i = 0; i < nMacros; i++) {
       if (macroNames[i].equals("Popup Menu")) {
         new MacroRunner(pgm, macroStarts[i], "Popup Menu", cmd);
         return;
       }
     }
   }
   runMacro(cmd);
 }