home page

Photo Mechanic Code Replacements:
A Life Changing Shortcut for Captioning Images   

Copyright 2021 by Michael Brochstein

I was ignorant, slowed down by writing out the formal titles and names of the same people day-after-day when I captioned an image of them using Photo Mechanic (PM). My quality of life has improved noticeably since I discovered an important feature of Photo Mechanic, Code Replacements, which eliminates this drudgery. Code Replacements will noticeably reduce the time you spend writing captions and also decrease the likelihood of typos in your captions. 

Code Replacements are commonly used in writing captions for sports but can be easily used in other areas where you repeatedly write the same name, title or phrase repeatedly. When filling in a PM metadata field (i.e. caption) one writes the code and instantly PM replaces the code with the full phrase, the replacement, that the code stands for.

Writing out "Green Bay Packers Quarterback Aaron Rogers" takes a lot longer than writing a code such as "gb12" where gb is short for Green Bay and 12 is the player's jersey number.  Similarly if you photograph politics then writing "aoc" instead of  "U.S. Representative Alexandria Ocasio-Cortez (D-NY)" is a lot easier and faster. The "replacement" does not have to be a name, it could be any phrase that you would otherwise have to write out regularly.

In order to tell PM what your code replacements are you need to create a text file (i.e. using "notepad" on Windows based computers) with your code replacements. On each line of the file is a code followed by a tab and then the replacement. Examples are below;

potus President Joe Biden
flotus First Lady Jill Biden
vpotus Vice President Kamala Harris
sgotus Second Gentleman Doug Emhoff

In addition, it is good to document your Code Replacements file so that it explains itself to you and others as you may forget its logic. Comment lines start with two forward slashes (//). This tells PM to ignore these lines.

// CONGRESS: SENATE; Sorted by state. Code = last name
murkowski U.S. Senator Lisa Murkowski (R-AK)
sullivan U.S. Senator Dan Sullivan (R-AK)
shelby U.S. Senator Richard Shelby (R-AL)

Since a goal of using Code Replacements is speed, eliminating keystrokes speed up their use. I use only lowercase codes so as to save a keystroke (the shift key). Please note that code are case sensitive and PM will see a code of "Fred" as being different from "fred".

Using Code Replacements will lessen the likelihood of typos as the replacement will have been carefully crafted when creating a Code Replacements file versus hastily written every time you write a caption while on deadline.

Once you have created a Code Replacements file you will need to upload it into PM. You do this by selecting "Set Code Replacements..." from PM's menu; Edit -> Settings -> Set Code Replacements... 

The Code Replacement box that is brought up will allow you to add the name(s) of Code Replacement file(s) - yes, you can have more than one. You will also use this box to reload a Code Replacement file as you update and/or improve your Code Replacements file.

In the Code Replacement box there is a field called "Delimiter Character". Typically there will be a backslash (\) in it. You can change it to what you want but I recommend sticking with a backslash unless you have a reason to change it. In order to use a Code Replacement. You write out your code with the delimiter character (backslash?) before and after it. For example, you write \potus\ when writing your code for "President Joe Biden" using the above Code Replacement example.

While the author uses a person's last name as a code, some people prefer to use a first initial followed by the last name. What to use as a code is up to you.

Click here to see a Code Replacement file for national (USA) politics circa 2021. The author has used it many times but does offer any guarantee that he has eliminated all typos (he's only human).

Feedback / Questions: Please feel free to email Michael Brochstein with any comments, suggestions and/or questions.
Full Disclosure: This is to let you know that the author has no financial interest in any of the items, vendors or websites mentioned on this page.

Michael Brochstein is an independent photojournalist based in Washington, DC and New York City.


 Last update: 6/7/2021

Copyright © 2021 Michael Brochstein. All rights reserved.