What is it?
Code replacement is a tool that allows you to quickly enter pieces of text by only typing a couple of characters. For example, while editing metadata for a football match you could type
\b1 into a metadata field and it could be automatically replaced by
scores a wonderful goal.
Code Replacement lists
Caption Pro has the ability to load text files containing a list of codes and their corresponding values. Once a list is loaded it's contents will be available for use throughout the project in all metadata fields.
To load a list, with the 'project metadata' modal open, simply click
add new in the section labelled Text Code Replacement and navigate to your code list file. Each list takes a few seconds to load before being available for use. To manage your lists on an existing project, select the 'edit project metadata' button on the right hand side of the interface (just above an image's metadata fields), and the 'Text Replacement Lists' option is at the top of that modal.
For those familiar with Photo Mechanic the expected format of the list is exactly the same. The file should have a
.txt extension. Each line represents a code and its replacement value, separated by a
TAB character. For example, given a file with the following contents:
b1 scores a wonderful goal
b2 receives a yellow card
b3 has been substituted
b1 is the code for
scores a wonderful goal,
b2 is the code for
receives a yellow card, and
b3 is the code for
has been substituted.
How to use code replacement while editing metadata
So you have your project with a code replacement list loaded, how do you start making code replacements? While editing metadata in any field, be it results, formula, or project, press the
\ (backslash) character at any point to bring up the code replacement search box.
You may also use code replacements when adding a new person record, in the search box, or in the name fields.
With the search box opened start typing any code and possible replacements will be displayed. Press up and down on your keyboard to navigate between the different options, and press
Tab to output the value of the current selection. You may also click with the mouse.
To close the search box without outputting any value press
The search box matches both codes and values, so if you can't remember the code but do know some of the text of the replacement value you can start typing that instead and the result should become available.
Also bear in mind that when the search box is first opened the most recently used results will be immediately visible, allowing you to quickly select from a few options that you use the most without typing anything.
Hopefully you now understand the benefit of code replacements and how to use them in Caption Pro. If you would like further help or have an issue please don't hesitate to get in touch using our chat widget in the bottom right here, or in Caption Pro by clicking the messaging button in the top menu.