Using Photo Mechanic’s Code Replacement Feature

On days when I’m not shooting anything or otherwise don’t feel like posting a new or fresh image, I’ll try to describe some of the short cuts and tips that I’ve learned to make life easier. Perhaps one of the biggest time savers for me, especially when shooting college athletics, is the ability to use code replacements in captioning my images. The concept is fairly simple — instead of remembering and typing out a name like Laurynas Mikalauskas, it’s a whole lot easier (and less prone to typo and spelling errors) to look at the number on his jersey and type out something like \v11\.
Where to get started….
If you’re shooting an event that’s either NFL, MLB, NHL, NBA, NCAA Football, or men’s or women’s NCAA Basketball, you’re in luck. There are automated web sites, available to the public, which will generate your rosters in a format that Photo Mechanic likes, and it’s just plug and play. There are a few quick codes and rules to learn and that’s about it. As far as I can tell, this was all started by a guy named Mike Stone. Mike’s Code Replacement Site provides rosters for all US professional sports and NCAA Football. I went ahead and created my own version, using the exact same naming and coding conventions as Mike, for NCAA Basketball — Code Replacements for Men’s NCAA Basketball and Code Replacements for Women’s NCAA Basketball.
These code replacement roster creation forms ask for a few fields. Home and visiting team prefix — this is the “code” that you want to use to represent a specific team. If Virginia was playing Arizona, I’d likely use “v” for Virginia and “a” for Arizona — pretty simple. Another option is to include player’s numbers in the roster file to be created. Using an “n” at the end of a code, i.e. \v11n\ would automatically spell out Laurynas Mikalauskas (11). Other codes to consider:
“t” at the beginning of your code, will insert the team name — i.e. \tv11\ = Virginia’s Laurynas Mikalauskas
“p” at the beginning of your code, or after the “t” will insert the player’s position — i.e. \pv11\ = forward Laurynas Mikalauskas and \tpv11\ = Virginia forward Laurynas Mikalauskas
In most of my captions, I typically put it all together — i.e. \tpv11n\ = Virginia forward Laurynas Mikalauskas (11)
There are several nuances with sports like football where multiple players can have the same number. Mike has addressed this and explains in greater detail in his Release Notes.
Using one of these resources, you’ll create a text file that you’ll then save to your computer. I put all of mine into a Roster folder, and rename them so that I know what event, day, etc. It’s a helpful short cut, should I need to go back to a shoot and re-caption/edit a batch of older images. Once the roster file has been created, I tell Photo Mechanic where to look for it. On my Mac, using PM version 4.5.3.2, it’s under the Edit -> Set Code Replacements menu at the top (you’ll get a window showing files already included, if any, and the option to add new ones). If you have an older version of PM or PC version, it may be buried somewhere in the “Preferences” menu option. Once you find it, add in your file. You will also note a field for a “Delimiter Character”. This is the beginning and end of your “code”. As in the example above, I’ve found that the backslash character “\” (without quotes) works very well. Other characters seemed to have problems, but you’re free to choose whatever you’d like.
One quick note: if you load multiple files into the set code replacement dialog, make sure that you aren’t overlapping team codes (i.e. the “v” and “a” in the example above). For example, let’s say Virginia played Arizona and you successfully loaded the roster file, no problem. Then the next game Virginia plays UNC-Asheville and you use the “a” also to designate UNC-A. When you type something like \tpa23n\ you’re likely to get an Arizona player if you didn’t previously remove the old roster from the list.
Then, if everything was created and loaded correctly, you are ready to start captioning using code replacements.
If you are shooting something that isn’t covered by one of the automated sites provided above (such as NCAA soccer, lacrosse, high school sports, etc.), you can still create your own code replacement files… it just takes a little longer. If you’re lucky enough to be covering an event where rosters are posted on the web, just cut and paste the roster into a text editor and apply your edits there. The resulting text file needs to be in tab-delimited form (the code followed by a tab followed by what you want displayed whenever you type the code in PM) – with a new line (return) between each record. Such a file (from NCAA field hockey) may look like:
[...]
m1 Maryland Terrapins Goalkeeper Melissa Vassalotti (1)
m3 Maryland Terrapins Back/Midfield Brianna Davies (3)
m4 Maryland Terrapins Forward Brigitte Strother (4)
m6 Maryland Terrapins Back Susie Rowe (6)
m7 Maryland Terrapins Back Emma Thomas (7)
[...]
You can mix and match things up i.e. changing the ‘m1′ code to spit out just “Melissa Vassalotti” but then creating another code called ‘tpm1n’ to replace with “Maryland Terrapins Goalkeeper Melissa Vassalotti (1)” — it’s up to you, you just have to do the work (which is why when manually creating my own rosters, I keep it very simple).
Thanks to Geoff Burke for introducing all of this to me a couple of years ago.
