Author Topic: Code Replacement HOW-TO  (Read 55991 times)

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Code Replacement HOW-TO
« Reply #15 on: May 08, 2006, 08:14:47 PM »
Kirk I'm on a Powerbook with Mac OS 10.4.6 and Photo Mechanic 4.4.2.
I'm using the IRL Code that I submitted to the Code Forum, perhaps you can check that to see if the problem might be in the code itself.

Yes, I see the problem.  Your files are not text files.  They are RTF files and are not plain-text.  Here is an excerpt from your file:

irl2    Tomas Scheckter, Vision Racing\

As you can see, the replacement text ends with a backslash character which explains why you are seeing that extra backslash appear when the replacement is inserted.

Change your files to plain-text and it should be all well again.

HTH,

-Kirk

Offline Pixel

  • Newcomer
  • *
  • Posts: 30
    • View Profile
Re: Code Replacement HOW-TO
« Reply #16 on: May 08, 2006, 08:45:11 PM »
That was it!
Thanks so much!!!!!!!!!!!!!!!!!!

Offline dbrouse

  • Full Member
  • ***
  • Posts: 190
    • View Profile
    • DC Corporate Headshots
Re: Code Replacement HOW-TO
« Reply #17 on: May 08, 2006, 10:02:14 PM »
Did you generate the file in Excel?  If not, try that and save the file as text (tab seperated). The files are RFT (rich text format???) so that may be the problem.

Delane B. Rouse/Rouse Photography Group, LLC
Mac OS: Version 10.7.4, Build 12713

Offline dbrouse

  • Full Member
  • ***
  • Posts: 190
    • View Profile
    • DC Corporate Headshots
Re: Code Replacement HOW-TO
« Reply #18 on: May 08, 2006, 10:06:36 PM »
Pixel...I was going to send you an updated file to see if it worked but I cant see how to attach the file in a Private Message....anyway...try this file and let me know how it works.

[attachment deleted by admin]
Delane B. Rouse/Rouse Photography Group, LLC
Mac OS: Version 10.7.4, Build 12713

Offline robk47

  • Newcomer
  • *
  • Posts: 33
    • View Profile
Re: Code Replacement HOW-TO
« Reply #19 on: May 10, 2006, 06:23:29 AM »
Maybe I am missing something...I am operating on a Windows platform and downloaded one of the files with the NASCAR names and car numbers to try the codes...I changed the file to .txt and cannot get it to work when I type the code: nas55 for Darrel Waltrip...am I missing something??  Can you use word and tab between code and name and save it as a .txt file?? Thanks.

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Code Replacement HOW-TO
« Reply #20 on: May 10, 2006, 06:33:07 AM »
Maybe I am missing something...I am operating on a Windows platform and downloaded one of the files with the NASCAR names and car numbers to try the codes...I changed the file to .txt and cannot get it to work when I type the code: nas55 for Darrel Waltrip...am I missing something??  Can you use word and tab between code and name and save it as a .txt file?? Thanks.

I removed the RTF files and fixed them.  Then I reposted them as plain-text files.  Just changing the filename extension from RTF to TXT does nothing at all to the actual data in the file.  Please re-download the NASCAR file from the Code Replacements message board.

And, just to make sure, are you typing \nas1\ into an IPTC text field?  It should work just fine.  Does for me.

-Kirk

Offline robk47

  • Newcomer
  • *
  • Posts: 33
    • View Profile
Re: Code Replacement HOW-TO
« Reply #21 on: May 10, 2006, 08:06:16 AM »
Kirk,
Hey, thanks...now, I just have to learn how to create text files to take advantage of this...what method would you recommend?? This will really be helpful with all of the sports I cover...
Rob

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Code Replacement HOW-TO
« Reply #22 on: May 10, 2006, 08:33:36 AM »
Kirk,
Hey, thanks...now, I just have to learn how to create text files to take advantage of this...what method would you recommend?? This will really be helpful with all of the sports I cover...

First check the Code Replacements message board to see if someone else has submitted a Code Replacement text file for the sports you cover.  If none fit your needs, then you will have to create your own.  Notepad is a good choice on Windows since it is already on your computer.  Code Replacement files are very simple, just two 'columns' of text in a text file.

Open Notepad.  You'll have an empty document with the cursor blinking in it.  Type in your first 'code' then press the 'Tab' key.  Then type in your 'replacement' then press the enter key.  Keep repeating these two steps until you have entered all of your codes and their replacements.  Then save your file as a TXT file, keeping the encoding as ANSI. 

Next open up PM and the open up the Preferences dialog.  Click on the IPTC/XMP tab.  Click on the 'Code Replacement..." button.  Use the "Add..." button to find your new file and Open it.  Click OK.

Now when you are in the IPTC dialogs, you can enter \code\ and PM will look for the word 'code' and if it is found, PM will replace \code\ with the replacement text for that code.  Remember to enter your actual code words instead of the word "code" ;)

Note that you can use Code Replacement for anything that you find tedious to type in, not just names of sports athletes.

HTH,

-Kirk

Offline robk47

  • Newcomer
  • *
  • Posts: 33
    • View Profile
Re: Code Replacement HOW-TO
« Reply #23 on: May 10, 2006, 09:23:43 AM »
 :) Thank you...I figured it out and have started creating codes for things that I type a lot...I appreciate this feature and was wondering if in future editions there could be a different control other than the two backslashes to initiate the code?? Again, this application just keeps getting better!!!

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Code Replacement HOW-TO
« Reply #24 on: May 10, 2006, 09:31:57 AM »
:) Thank you...I figured it out and have started creating codes for things that I type a lot...I appreciate this feature and was wondering if in future editions there could be a different control other than the two backslashes to initiate the code?? Again, this application just keeps getting better!!!

I plan to have the next update allow you to customize the character, because '\' is hard to type on some keyboards.

-Kirk

Offline emgab

  • Newcomer
  • *
  • Posts: 36
    • View Profile
Re: Code Replacement HOW-TO
« Reply #25 on: July 02, 2006, 03:05:18 PM »
:) Thank you...I figured it out and have started creating codes for things that I type a lot...I appreciate this feature and was wondering if in future editions there could be a different control other than the two backslashes to initiate the code?? Again, this application just keeps getting better!!!

I plan to have the next update allow you to customize the character, because '\' is hard to type on some keyboards.

-Kirk

Yes, please.. because on my Thinkpad german keyboard, i have to type <ALT GR>+<?ß\> and this will advance to the next picture.. so far i havent figured out, which key to use.. maybe you have a clue which one i should use..
Mike

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Code Replacement HOW-TO
« Reply #26 on: July 03, 2006, 01:13:15 PM »
:) Thank you...I figured it out and have started creating codes for things that I type a lot...I appreciate this feature and was wondering if in future editions there could be a different control other than the two backslashes to initiate the code?? Again, this application just keeps getting better!!!

I plan to have the next update allow you to customize the character, because '\' is hard to type on some keyboards.

-Kirk

Yes, please.. because on my Thinkpad german keyboard, i have to type <ALT GR>+<?ß\> and this will advance to the next picture.. so far i havent figured out, which key to use.. maybe you have a clue which one i should use..
Mike

I have just written code to allow you to choose your own delimiter character.  It will appear in the next update.

-Kirk

Offline jay

  • Newcomer
  • *
  • Posts: 1
    • View Profile
Re: Code Replacement HOW-TO
« Reply #27 on: October 11, 2006, 12:21:21 PM »
Kirk

Thanks for all your great help with the code replacements

Is it no possible to use an alternate control character other than \ and if so how

Best
Jay

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Code Replacement HOW-TO
« Reply #28 on: October 11, 2006, 01:15:00 PM »
Jay,

Kirk

Thanks for all your great help with the code replacements

Is it no possible to use an alternate control character other than \ and if so how

In the 4.4.3.3 version you can customize the delimiter character in the Code Replacement dialog.  Open the Preferences dialog, click on the IPTC/XMP tab and then click on the Code Replacement... button.  In the Code Replacement dialog you can replace '\' with a different character.

HTH,

-Kirk

Offline dsidaway

  • Newcomer
  • *
  • Posts: 27
    • View Profile
Re: Code Replacement HOW-TO
« Reply #29 on: June 17, 2010, 05:09:24 PM »
In case someone hasn't already noted, Mike Stone (stonepix.com) posts code replacement lists for NHL, NBA, NFL, MLB and NCAA Football. Very convenient when teams make changes to rosters.