Author Topic: Code replacement issue - or feature?  (Read 6388 times)

Offline Pavel

  • Member
  • **
  • Posts: 89
    • View Profile
Code replacement issue - or feature?
« on: August 23, 2006, 07:37:22 AM »
I've only recently started to use code replacement.  It is fantastic.  I didn't use it before because I didn't realize that you can put in multiple fields separated by a comma so better late than never.

My issue is this.  I set it up so that I can use the * character instead of the \.  Just a bit less movement when you use the keypad because all I use are numbers.  What happens however is that whicever you use the \ or the * character the code replacement places a \ at the end of the code replacement values.

for example if I type "*11*", I get "11,Ben Spies,Team Suzuki\" placed in as the code replacements.  The irritation is that the "\" shows up at the end and I have to remove it for each of the 3000 pictures.  Is that supposed to be the way it works or is that a bug?  I can see that it can speed things up for multiple entries, which I've got plenty of but then one would think that if you use a different character, that same character would populate that spot.  Of course I'd preffer not to have it pop in at all.

The other minor annoyance is that spaces don't seem to be respected.  I find that sometimes the double spaces I put in-between keywords are there while other random times they are not.  Not a big deal though.

Anyway - keep up the fantastic work in refining this product.  This code replacement is worth many hours of sweat - now that I've seen the light.

OSX 10.4.7 and 4.4.3.2 of photomechanic.
Thanks!

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24817
    • View Profile
    • Camera Bits, Inc.
Re: Code replacement issue - or feature?
« Reply #1 on: August 23, 2006, 08:48:55 AM »
I've only recently started to use code replacement.  It is fantastic.  I didn't use it before because I didn't realize that you can put in multiple fields separated by a comma so better late than never.

My issue is this.  I set it up so that I can use the * character instead of the \.  Just a bit less movement when you use the keypad because all I use are numbers.  What happens however is that whicever you use the \ or the * character the code replacement places a \ at the end of the code replacement values.

for example if I type "*11*", I get "11,Ben Spies,Team Suzuki\" placed in as the code replacements.  The irritation is that the "\" shows up at the end and I have to remove it for each of the 3000 pictures.  Is that supposed to be the way it works or is that a bug?  I can see that it can speed things up for multiple entries, which I've got plenty of but then one would think that if you use a different character, that same character would populate that spot.  Of course I'd preffer not to have it pop in at all.

The other minor annoyance is that spaces don't seem to be respected.  I find that sometimes the double spaces I put in-between keywords are there while other random times they are not.  Not a big deal though.

It may be a bug.  '*' is a wildcard character in regular expressions.  What if you (just for testing) use something else like '\' and try it again?  Does it still put in an ending '\'?

Your code replacement file should look something like this:

11[tab]11,Ben Spies,Team Suzuki
17[tab]17,Miguel Duhamel,Team Honda

Where [tab] is a tab character (can't be represented on the forums).

As for the spacing issue, can you either post an excerpt of your code replacement text file, or send it to me directly?

Thanks,

-Kirk

Offline Pavel

  • Member
  • **
  • Posts: 89
    • View Profile
Re: Code replacement issue - or feature?
« Reply #2 on: August 23, 2006, 11:32:49 AM »
Kirk, I just tested it out with "/", the default "\" and the "*" that I've been using.  In all cases it put in a trailing "\".  The interesting thing is that with the default set the trailing "\" is useful in that it does save a keystroke as it works for the next code replacement - if there happens to be one more to put in.  With the other characters you of course have to put in two around the code replacement and you are left with a "\" in between.

I like to use the * as it is on the keypad right in the corner so I don't have to pay as close attention when going fast but the "/" would be ok too - except that it works wonky that way the same as with the "*".

How do I send you the text file that I've been using?  Should I put a "tab" at the end of each entry?  I haven't done that but I wonder if it would change anything. 

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24817
    • View Profile
    • Camera Bits, Inc.
Re: Code replacement issue - or feature?
« Reply #3 on: August 23, 2006, 11:38:56 AM »
Kirk, I just tested it out with "/", the default "\" and the "*" that I've been using.  In all cases it put in a trailing "\".  The interesting thing is that with the default set the trailing "\" is useful in that it does save a keystroke as it works for the next code replacement - if there happens to be one more to put in.  With the other characters you of course have to put in two around the code replacement and you are left with a "\" in between.

I like to use the * as it is on the keypad right in the corner so I don't have to pay as close attention when going fast but the "/" would be ok too - except that it works wonky that way the same as with the "*".

How do I send you the text file that I've been using?  Should I put a "tab" at the end of each entry?  I haven't done that but I wonder if it would change anything. 

Send me a private message and I'll give you server upload information.

Thanks,

-Kirk

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24817
    • View Profile
    • Camera Bits, Inc.
Re: Code replacement issue - or feature?
« Reply #4 on: August 28, 2006, 04:49:25 PM »
Kirk, I just tested it out with "/", the default "\" and the "*" that I've been using.  In all cases it put in a trailing "\".  The interesting thing is that with the default set the trailing "\" is useful in that it does save a keystroke as it works for the next code replacement - if there happens to be one more to put in.  With the other characters you of course have to put in two around the code replacement and you are left with a "\" in between.

I like to use the * as it is on the keypad right in the corner so I don't have to pay as close attention when going fast but the "/" would be ok too - except that it works wonky that way the same as with the "*".

How do I send you the text file that I've been using?  Should I put a "tab" at the end of each entry?  I haven't done that but I wonder if it would change anything. 

I just got your sample file.  It is in RTF (Rich Text Format) instead of plain TXT format.  RTF intermingles formatting commands throughout the text, using backslashes for delimiters.  For instance your file contains entries like:

\f0\fs24 \cf0 o1   Mat Mladin\
o2   Jamie Hacking\

I'll bet you didn't enter any of that stuff before "o1 Mat Mladin" and you didn't enter the trailing backslash after Mladin's name either.  The text editor's RTF output did that behind your back.

You need to use a text editor that allows you to save/load plain text files.  Since you're on Mac OS X, I can wholeheartedly recommend TextWrangler from Bare Bones Software.  You can get it here.  It's really good and it is free.

Just make sure you save as plain text and then load it back into Code Replacement.  Your problems should be solved.

HTH,

-Kirk

Offline Pavel

  • Member
  • **
  • Posts: 89
    • View Profile
Re: Code replacement issue - or feature?
« Reply #5 on: August 28, 2006, 05:21:37 PM »
Thanks.  I used textedit and when I went to save it did it in rich text format.  so I changed the prefs and saved it in plain text.  Thanks for the solution.  I've got textwrangler but didn't use it - but will in the future.  THANKS - it works now!
« Last Edit: August 28, 2006, 05:35:02 PM by Pavel »