Author Topic: Variable use in Find and Replace?  (Read 3465 times)

Offline jr_ed

  • Newcomer
  • *
  • Posts: 17
    • View Profile
Variable use in Find and Replace?
« on: February 28, 2015, 04:05:39 PM »
Is there any way to use variables in the replace portion of Find and Replace?

Here's my issue: I normally have a string like this in my Description/Caption to give shooting information:

{lt} @ {lens}mm f{f} {ss}s ISO{iso}

Somehow I dropped the {lt} from a few hundred files I processed, so I now have captioned photos with something like

 @ 600mm f7 1/125s ISO1600

I was planning to do a find on " @ " and replace it with "{lt} @ ", but that seems to insert the literal "{lt}" in the caption.

Am I doing something wrong, or are variables not supported in Replace? If the latter, do you have any other clever workarounds to fix this problem?

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Variable use in Find and Replace?
« Reply #1 on: February 28, 2015, 08:32:53 PM »
Now that the {lt} is in your captions, you can open each one up, hold down the 'shortcut key' (Option on Mac and Shift on Windows) and you'll notice that the OK button changes to "Eval" which will evaluate the variables.  Then use Save & -> to go on to the next one.  Kind of tedious, but it's the only solution I can think of.

-Kirk

Offline jr_ed

  • Newcomer
  • *
  • Posts: 17
    • View Profile
Re: Variable use in Find and Replace?
« Reply #2 on: March 01, 2015, 04:27:29 PM »
That worked, but was definitely tedious (and not very ergonomic).

I'm guessing that if you've never added variable support to replace fields, it's because it would be technically non-trivial to add this (not because no one has ever asked for this feature)?

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Variable use in Find and Replace?
« Reply #3 on: March 01, 2015, 06:20:58 PM »
That worked, but was definitely tedious (and not very ergonomic).

I'm guessing that if you've never added variable support to replace fields, it's because it would be technically non-trivial to add this (not because no one has ever asked for this feature)?

No one has asked for it and I don't know how hard it would be to implement it.  Variables on the replace make a lot of sense, but if variables were to be used on the find, what image metadata would be used to expand the variables in the find string?  I suppose it makes sense to evaluate them on each image that is a find candidate but I haven't thought it completely through.

-Kirk

Offline jr_ed

  • Newcomer
  • *
  • Posts: 17
    • View Profile
Re: Variable use in Find and Replace?
« Reply #4 on: March 02, 2015, 01:14:36 AM »
I think variables on the replace end would be straight forward.

On the find end, there are probably multiple ways to do things. Certainly evaluating it on each image and could make it a pretty powerful feature. (For example, say I decided I wanted to replace {lens} with {lens35} in each image. Evaluating on a per-image basis could enable this, and could be a big help for making changes to large quantities of images.)

However a feature like this is implemented, it would probably be good to have some kind of on/off function for variable evaluation, in case someone doesn't want variable evaluation.