Author Topic: A Next Generation Code Replacement feature  (Read 26647 times)

Offline FairfieldPhoto

  • Full Member
  • ***
  • Posts: 240
    • View Profile
    • Fairfield Photography, LLC
A Next Generation Code Replacement feature
« on: April 26, 2008, 05:57:37 AM »
It has been a long time since I have had the urge to enter a feature request.  Frankly, PM does everything I need right now and I am just squeezing every penny out of my investment by shooting and selling.

However, I recently ran into an event where I needed to use Code Replacement for multiple fields.  This meant breaking down the process to multiple passes of 1800+ images.  Spent a long time in the hotel getting the images ready when one pass could have done the job.  I have a riders number, but needed to embed First Name, Last Name, Team, Horse Name, Event, Address, E-mail, Phone Number, and School.

Sooooo,

Can you please update the code replacement to allow multiple tab-delimited columns?  How do you know which column goes with which field you say?  Try this:

\{suppcat2}\       - The first column of replacement text (just how it works today)
\\{suppcat2}\\     - The second column of replacement text
\\\{suppcat2}\\\   - The third column

etc., etc.

I would think the only limit would the photographer's patience to type in some number of "\".  A useful edit would be to ensure the same number of "\" exist before and after the variable.

Thoughts?

-Mike
Fairfield Photogaphy


Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: A Next Generation Code Replacement feature
« Reply #1 on: April 27, 2008, 09:16:52 AM »
Excellent suggestion!

I would just add the ability to include keywords somehow as I mentioned in this thread:

http://forums.camerabits.com/index.php?topic=2872.msg12969#msg12969

I might suggest this format as a possible alternative

\{suppcat2}\        - The first column of replacement text (just how it works today)
\{suppcat2#1}\     - Same as above
\{suppcat2#2}\     - The second column of replacement text
\{suppcat2#3}\     - The third column

Just have to decide whether you want the index to the column number to be 1 based (as these examples are) or zero based  ;)

Deven

Note I changed \{suppcat2:1}\ to \{suppcat2#1}\ because the colon character is already being used in the PM variable syntax.
« Last Edit: April 27, 2008, 10:50:37 AM by devenh »

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: A Next Generation Code Replacement feature
« Reply #2 on: May 01, 2008, 02:50:49 AM »
Ah, excellent suggestions!  And while we're at it, can I suggest a further two features?

1. Allow blanks as replacement text.  Currently a line with nothing for the replacement text (i.e., code followed by only a tab character) gets ignored

2. If a code can't be found, leave it as it is (e.g., replacement text equals the code).  Currently, the text is surrounded by the delimiter (e.g., a \).

Cheers.
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: A Next Generation Code Replacement feature
« Reply #3 on: May 01, 2008, 06:27:46 AM »
Ah, excellent suggestions!  And while we're at it, can I suggest a further two features?

1. Allow blanks as replacement text.  Currently a line with nothing for the replacement text (i.e., code followed by only a tab character) gets ignored

What would be the use?

Quote from: Hayo Baan
2. If a code can't be found, leave it as it is (e.g., replacement text equals the code).  Currently, the text is surrounded by the delimiter (e.g., a \).

That would eliminate the possibility of doing things like looking up a variable from another IPTC field as a Code:  /{object}/ would be replaced by {object} immediately instead of being used as a lookup.

-Kirk



Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: A Next Generation Code Replacement feature
« Reply #4 on: May 01, 2008, 06:57:25 AM »
What would be the use?

This would allow you to selectively erase data in fields.  I can see the value in that.  I think if one goes to the trouble of adding a line to the CR text of:

code tab blank

then some action should be taken, not just ignore it.


That would eliminate the possibility of doing things like looking up a variable from another IPTC field as a Code:  /{object}/ would be replaced by {object} immediately instead of being used as a lookup.

For me, this situation is more akin to a "compiling error."  What I mean by this is that if I go to the trouble of adding CR, my expectation is that every CR will be replaced.  Right now, PM gives me no indication that my "program failed to compile" as no error is displayed.  In order to check if the CR did work, I have to sort my photos by the field containing the CR and check.  I think this behavior could be improved.

Deven

Edit: As explained in reply #9 below, I don't use "live" CR, but rather indirectly.  In this context, the above comment will hopefully be clearer.
« Last Edit: May 01, 2008, 10:38:52 AM by devenh »

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: A Next Generation Code Replacement feature
« Reply #5 on: May 01, 2008, 08:02:43 AM »
Deven,

What would be the use?

This would allow you to selectively erase data in fields.  I can see the value in that.  I think if one goes to the trouble of adding a line to the CR text of:

code tab blank

then some action should be taken, not just ignore it.

Again, what is the use of that?  Why would I want to type at least three characters in order to insert a couple of spaces?

-Kirk


Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: A Next Generation Code Replacement feature
« Reply #6 on: May 01, 2008, 08:05:08 AM »
Deven,

That would eliminate the possibility of doing things like looking up a variable from another IPTC field as a Code:  /{object}/ would be replaced by {object} immediately instead of being used as a lookup.

For me, this situation is more akin to a "compiling error."  What I mean by this is that if I go to the trouble of adding CR, my expectation is that every CR will be replaced.  Right now, PM gives me no indication that my "program failed to compile" as no error is displayed.  In order to check if the CR did work, I have to sort my photos by the field containing the CR and check.  I think this behavior could be improved.

If you hold down the Modifier key (Shift on Windows, Option on Mac OS X) then the OK button in the IPTC Info dialog becomes "Eval" and clicking on it does all variables substitution and replaces the fields with the result.

HTH,

-Kirk


Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: A Next Generation Code Replacement feature
« Reply #7 on: May 01, 2008, 08:24:54 AM »
Again, what is the use of that?  Why would I want to type at least three characters in order to insert a couple of spaces?

Maybe after you typed in the CR text you decided you wanted to remove it?

I frankly see the value of this being more useful in the context of the field enhancement discussed earlier in this thread.

Deven

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: A Next Generation Code Replacement feature
« Reply #8 on: May 01, 2008, 09:37:26 AM »
Deven,

Again, what is the use of that?  Why would I want to type at least three characters in order to insert a couple of spaces?

Maybe after you typed in the CR text you decided you wanted to remove it?

Wouldn't it be easier just to hit the backspace key one more time than it would to erase the partial code and type in the one that evaluates to a blank?

Quote from: devenh
I frankly see the value of this being more useful in the context of the field enhancement discussed earlier in this thread.

Absolutely.

-Kirk


Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: A Next Generation Code Replacement feature
« Reply #9 on: May 01, 2008, 09:59:13 AM »
Wouldn't it be easier just to hit the backspace key one more time than it would to erase the partial code and type in the one that evaluates to a blank?

Sorry for not being as clear as I should be.  I probably use CR a little differently than most (surprise?).

I rarely use "live" CR in the sense that I type \xyz\ and have it automatically expand.  Rather I type xyz into a field (typically Caption Writer) and then add \{CaptionWriter}\ to the field I really want to populate using Apply Stationery to all the photos.  Let's say I've done this and later decide that I want to erase the replacement text associated with the code abc.  One way of doing this (assuming the feature being discussed was implemented and, granted, there are other ways to achieve this result) would be to edit the CR text and place a blank in the abc text and reapply the Apply Stationery command.

Deven
« Last Edit: May 01, 2008, 10:00:44 AM by devenh »

Offline FairfieldPhoto

  • Full Member
  • ***
  • Posts: 240
    • View Profile
    • Fairfield Photography, LLC
Re: A Next Generation Code Replacement feature
« Reply #10 on: May 01, 2008, 10:12:43 AM »
I had already asked about a feature for a value that could be specified for the "no code substitution found" situation.  I know that would be useful for when promoters forget to give me information on all of the competitors.

-Mike

Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: A Next Generation Code Replacement feature
« Reply #11 on: May 01, 2008, 10:41:59 AM »
I had already asked about a feature for a value that could be specified for the "no code substitution found" situation.  I know that would be useful for when promoters forget to give me information on all of the competitors.

... and when you mistype the code ...

Deven

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: A Next Generation Code Replacement feature
« Reply #12 on: May 01, 2008, 11:33:09 AM »
Mike,

I had already asked about a feature for a value that could be specified for the "no code substitution found" situation.  I know that would be useful for when promoters forget to give me information on all of the competitors.

I suppose we could do that (replace the text with a little error message) if the code doesn't look like a variable is being looked up.

How does that sound?

-Kirk


Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: A Next Generation Code Replacement feature
« Reply #13 on: May 01, 2008, 11:51:26 AM »
Kirk,

If you are still referring to the allowing blanks as a code replacement: No, that wouldn't do!  I want to be able to have "nothing" as a replacement text.  This allows you to use variables to trigger certain replacement texts, and have no text in special cases.  I could then for instance replace \{model:0,5}\ with nothing if it were (say) NIKON.  There's all sorts of things this is useful for!

Regarding my second request (leaving the replacement alone if none is found), using the same example as above, say I didn't have a CR line with NIKON in my CR specifications, I would then like \{model:0,5}\ to give me NIKON, and not \NIKON\ as it currently does.

Does this make sense?  Perhaps as an option?
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: A Next Generation Code Replacement feature
« Reply #14 on: May 01, 2008, 01:00:09 PM »
I had already asked about a feature for a value that could be specified for the "no code substitution found" situation.  I know that would be useful for when promoters forget to give me information on all of the competitors.

I suppose we could do that (replace the text with a little error message) if the code doesn't look like a variable is being looked up.

For me that doesn't do much to improve the work flow.  With or without the change I still have to find the problem files, which usually means sorting the images by the CR field.

What I would suggest is that a "no code substitution found" dialog box pop up asking if I would like to select all the images which have a problem.  To be clear, a blank substitution would not raise this error, only if the code itself was not found.

Deven