Author Topic: Code replacement does not expand {nl} at first  (Read 775 times)

Offline michaelbothager

  • Member
  • **
  • Posts: 51
    • View Profile
Code replacement does not expand {nl} at first
« on: May 08, 2022, 08:44:46 PM »
I’m exporting multiline captions from some images, and using code replacement to insert these captions into other files. In the export, I’ve selected ‘Make text Code Replacement friendly’. I'm exporting toTSV files.

The Export is like this:
Code: [Select]
{fbas}{tab}{caption}{tab}{keywords}
When evaluating the code replacement in the target images, the {nl} is not changed to actual newlines. The caption has the literal text '{nl}'.

Example:
Quote
Contacts Binder 08-096{nl}{nl}09.04.2022

If I manually do a second eval (option-click the OK button in the IPTC Info dialog), the {nl}’s are changed to newlines.

It's not feasible to manually go through all the images, or to remember to do a find/replace for {nl} each time I migrate captions between images.

Is this a bug, or is something amiss in my system?

Build 6474
macOS 10.15.7, Region: Denmark, Preferred languages: English (UK) – primary and Danish, Keyboard: Danish


/Michael

Online Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24764
    • View Profile
    • Camera Bits, Inc.
Re: Code replacement does not expand {nl} at first
« Reply #1 on: May 08, 2022, 10:05:03 PM »
Michael,

Sounds like a bug to me.  Can you list the set of steps required to reproduce the issue and post a sample code replacement text file that can be used to reproduce the problem, please?

-Kirk

Offline michaelbothager

  • Member
  • **
  • Posts: 51
    • View Profile
Re: Code replacement does not expand {nl} at first
« Reply #2 on: May 08, 2022, 10:34:03 PM »
Kirk,

Michael,

Sounds like a bug to me.  Can you list the set of steps required to reproduce the issue and post a sample code replacement text file that can be used to reproduce the problem, please?

-Kirk

No problem. I've added a zip with the files and screen shots.

1: Select image(s) with multiple lines in the Caption
2: Create an Text Exporter for {filenamebase}{tab}{caption} - see attached _TEST HC.snap
3: Export the text to code replacement file - see attached test.tsv, which contains {nl}
4: Add previous code replacement file (step 3) to Code Replacements (ctrl+cmd+c)
5: Reselect the image(s) from from step 1, clear the captions and enter the variable/hot code [pm-test.caption] - see attached 1-pre-eval.png
6: alt-click the OK button to eval,  Caption contains {nl} - see attached 2-eval-1.png.
7: alt-click the OK button a second time, the {nl} are exchanged for proper newlines - see attached 3-eval-2.png

/Michael