Systematic design of RF photoguns involves multiple RF simulations in conjunction with beam dynamic simulations. RF simulations include tuning gun frequency, matching the gun to the feeding RF circuit, balancing the on axis electric fields between gun cells, minimizing surface electric and magnetic fields and power consumption, and optimizing separation of resonant mode frequencies. We created a tool that allows this multiple parameter optimization to be done automatically. We used SUPERFISH to accomplish the RF simulations. We present an example of the rf photogun TOPGUN design using these tools.