Prevent iTunes and Photos from launching on media buttons
On my work computer, I fight a constant struggle against the standard apps in OSX that launch at the most inopportune times. The greatest offenders are iTunes, that hijack the media buttons (back, play/pause and forward) to launch itself and Photos, that likes to start up every time I hook in a new iOS device.
However, there is actually a simple, built-in way that will prevent this from ever
happening. If you go into the /Applications/
folder and bring up the info sheet
for the Application in question and select “No Access” for the groups everyone
and system. You must first click the little lock in the lower right and
enter your admin password to allow you to make changes. This will prevent those apps
from ever launching again, they will only briefly appear in the Dock when prompted.

The only drawback of this method is that you can no longer use those apps. However, for me that has a dedicated work machine. This is a very reasonable sacrifice. I have no desire to open Photos on it and preventing me from doing so is only a benefit in my eyes.