Author Topic: Using Code Replacements in the IPTC Template  (Read 1847 times)

Offline RogerB

  • Newcomer
  • *
  • Posts: 38
    • View Profile
Using Code Replacements in the IPTC Template
« on: July 08, 2022, 11:16:37 AM »
In the "Advanced Code Replacements" article on the Camera Bits Support Site (Solution home > Photo Mechanic 6 > Variables and code replacements > Advanced code replacements) the final section (More Code Replacement Ideas) gives an example of a wedding photographer putting the code replacement codes in the IPTC Template and then editing the code replacement file for each wedding.

I'm trying to get that technique to work, but the problem is that as soon as the closing delimiter is typed in the IPTC Template field the code replacement is immediately evaluated, either to the value in the currently loaded file or to the defined default if the code doesn't exist. That means the technique described in the support article won't work, as the code replacement happens immediately and can't be stored in the template for later evaluation.

Is it possible to use code replacements in the way described in that article?  If so, I'd appreciate some guidance on how to delay the evaluation of the code replacement to allow it to be stored in the IPTC Template and only be evaluated when the template is applied.  If it won't work at all, please could the support article be updated to reflect the actual functionality of PM in this area?

Offline Mick O (Camera Bits)

  • Camera Bits Staff
  • Hero Member
  • *****
  • Posts: 553
    • View Profile
    • Camera Bits
Re: Using Code Replacements in the IPTC Template
« Reply #1 on: July 08, 2022, 12:19:46 PM »
Hi Roger,

One way is to simply fill out your Metadata Template before you load the code replacement file -- and before setting a default replacement.  I will update the documentation to point this out.  Once you have created and saved the template(s), you can then set a default replacement and load in new code replacement files

-Mick
Mick O
Camera Bits

Offline RogerB

  • Newcomer
  • *
  • Posts: 38
    • View Profile
Re: Using Code Replacements in the IPTC Template
« Reply #2 on: July 08, 2022, 03:01:34 PM »
Hi Mick - Thanks, I cleared out the default replacement and it worked as expected.  Once I had the template set up I saved it as a snapshot and then restored the default, and all seems good.

Thanks again
Roger