I typically use recursive code replacements to write captions. For example ($ being the my code replacement delimiter):
=s520228 one
!cpvm $ competes in the men's pole vault on day $=s{year2}{mn0}{day0}$ of the {event} at {location} on {dow}, {monthname} {day}, {year4} in {city}, {country}
When entering the code replacement $!cpvm$, I get the text $ competes in the men's pole vault on day $=s{year2}{mn0}{day0}$ of the {event} at {location} on {dow}, {monthname} {day}, {year4} in {city}, {country}.
To get the full caption $ competes in the men's pole vault on day one of the Swiss Athletics Indoor Championships at Athletic Center St.Gallen on Saturday, February 22, 2025 in St. Gallen, Switzerland, I have to click on EVAL (Shift+OK).
It would be great if PhotoMechanics would recursively evaluate code and variable replacements!