Author Topic: Carriage Return during paste function into IPTC Caption field  (Read 4115 times)

Offline FairfieldPhoto

  • Full Member
  • ***
  • Posts: 240
    • View Profile
    • Fairfield Photography, LLC
I noticed a difference in how the Paste operation works.  Not sure where this started occurring because I haven't done much race number coding over the last few months.  If I do a CTRL+A to select the contents of the Caption field and then go to the next image in the folder and do a CTRL+V (Paste), I get the right contents pasted in PLUS I am getting what seems to be an extra carriage return so the cursor is below the text I just pasted.  Not normally a problem except when I want to run this through code replacement with \{caption}\, it can't find the right code to replace because it sees the carriage return/line feed.

Can you double check the Paste function in 4.6.3?  I tried this on 4.5.3 and it worked just fine.  Would be nice that if I select ALL and paste in a value that is all on one line, that the extra CR is NOT appended to the end.

Thanks!

-Mike

Windows XP SP3
PM 4.6.3

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Carriage Return during paste function into IPTC Caption field
« Reply #1 on: March 07, 2010, 05:34:20 PM »
Mike,

I noticed a difference in how the Paste operation works.  Not sure where this started occurring because I haven't done much race number coding over the last few months.  If I do a CTRL+A to select the contents of the Caption field and then go to the next image in the folder and do a CTRL+V (Paste), I get the right contents pasted in PLUS I am getting what seems to be an extra carriage return so the cursor is below the text I just pasted.  Not normally a problem except when I want to run this through code replacement with \{caption}\, it can't find the right code to replace because it sees the carriage return/line feed.

Can you double check the Paste function in 4.6.3?  I tried this on 4.5.3 and it worked just fine.  Would be nice that if I select ALL and paste in a value that is all on one line, that the extra CR is NOT appended to the end.

I'll see what I can do, but PM doesn't intercept Cut, Copy, and Paste and make it act any differently.  The MFC framework and the OS does all of that stuff.

-Kirk

Offline FairfieldPhoto

  • Full Member
  • ***
  • Posts: 240
    • View Profile
    • Fairfield Photography, LLC
Re: Carriage Return during paste function into IPTC Caption field
« Reply #2 on: March 07, 2010, 06:59:50 PM »
Let me know if you can recreate the behavior.  If not, it might be something local (or I can get you a screen shot of the cursor in the "wrong" place".)

-Mike

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Carriage Return during paste function into IPTC Caption field
« Reply #3 on: March 08, 2010, 07:25:59 AM »
Let me know if you can recreate the behavior.  If not, it might be something local (or I can get you a screen shot of the cursor in the "wrong" place".)

If I delete all characters from the Caption field before pasting, I cannot get the problem to happen.  If I paste onto the end of an existing caption that does not have an empty line then the problem also does not occur.

Actually I don't see any issue at all.  Are you certain you don't already have a line-ending already in place and that you're pasting at a cursor position just before the line-ending?  That would do it, and I can verify that I can reproduce the behavior, but it is expected to behave that way under that circumstance.

-Kirk

Offline FairfieldPhoto

  • Full Member
  • ***
  • Posts: 240
    • View Profile
    • Fairfield Photography, LLC
Re: Carriage Return during paste function into IPTC Caption field
« Reply #4 on: March 08, 2010, 10:03:50 AM »
I see what you mean.  Here is the exact scenario I am running into.  I am using the Caption field to put runner number into through the IPTC panel.  There are times in the photo when there are multiple runners in the shot and I put every number I can see (separated with a delimiter).  If I have multiple photos of that pack of runners, I used to be able to copy the contents of Caption (CTRL+A then CTRL+C) in the first image, then move to the next image with that same pack of runners (ALT+]) and then paste (CTRL+V) the string of numbers (so I don't have to retype a bunch of numbers).  Even if I have just a single number, the copy/paste saves me time over typing the numbers in again.

The problem comes in when the result of the paste operation adds the CR/LF *AND* I have a \{caption}\ function set later in the process.  Code replacement hates the CR/LF.

If I am just printing the contents of Caption, no one will really notice the CR/LF. But code replacement is a problem.

Perhaps a test to strip any extra CR/LF in a field before the code replacement function???

-Mike

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Carriage Return during paste function into IPTC Caption field
« Reply #5 on: March 08, 2010, 12:10:45 PM »
Mike,

I see what you mean.  Here is the exact scenario I am running into.  I am using the Caption field to put runner number into through the IPTC panel.  There are times in the photo when there are multiple runners in the shot and I put every number I can see (separated with a delimiter).  If I have multiple photos of that pack of runners, I used to be able to copy the contents of Caption (CTRL+A then CTRL+C) in the first image, then move to the next image with that same pack of runners (ALT+]) and then paste (CTRL+V) the string of numbers (so I don't have to retype a bunch of numbers).  Even if I have just a single number, the copy/paste saves me time over typing the numbers in again.

The problem comes in when the result of the paste operation adds the CR/LF *AND* I have a \{caption}\ function set later in the process.  Code replacement hates the CR/LF.

If I am just printing the contents of Caption, no one will really notice the CR/LF. But code replacement is a problem.

Perhaps a test to strip any extra CR/LF in a field before the code replacement function???

You evaluate the entire contents of the Caption field as a 'code' for code replacement?

-Kirk

Offline FairfieldPhoto

  • Full Member
  • ***
  • Posts: 240
    • View Profile
    • Fairfield Photography, LLC
Re: Carriage Return during paste function into IPTC Caption field
« Reply #6 on: March 08, 2010, 01:38:43 PM »
Yes, only because it is conveniently the first field displayed *and* large enough that I can hit it quickly with a mouse / trackpad instead of trying to get into one of the smaller fields.  For my workflow, there is nothing significant about Caption itself, only the convenience of the field's location.

-Mike