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

Offline jdemott

  • Newcomer
  • *
  • Posts: 11
    • View Profile
Code Replacement HOW-TO
« on: May 02, 2006, 11:39:38 AM »
Hello,

I'm trying to experiment w/ the Code Replacement feature of PM and can't find details w/ regards to txt file naming/locations/how to load.  I've got the concepts/formatting down, I just can't find any specifics in the ReadMe's and the new/old forums.

Thanks,

-Jason

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Code Replacement HOW-TO
« Reply #1 on: May 02, 2006, 01:53:16 PM »
From the still unreleased manual:

Code Replacement is a feature new to Photo Mechanic which speeds up captioning of often-used terms or names like those used in sports photography, but can be used as a method of shorthand for any type of photography.

To use Code Replacement, you must prepare a plain text file in tab-separated format.  You can use any text editor, or a spreadsheet program like Microsoft Excel™ to generate the text file.  The format of the text file is simple.  It is comprised of two ‘columns’, the first being the ‘Code’ and the second being the ‘Replacement’.  These two ‘columns’ are separated by a ‘tab’ character.  Ideally, you want your codes to be as short as possible while being completely unique.

Here is an example Code Replacement text file used for Basketball (Detroit Dunkers and Chattanooga Choo-Choos):

CC8   Dain Bramage
CC17   Rick Perkins
CC43   Brian Calloway
CC13   Dennis George
CC11   Darrin Green
CC2      Aaron Barnum
...
DD41   Stanislav Zarubezhanin
DD43   Paul Kroyd
DD24   Ken Pierce
DD44   Brian Socoletto
DD55   Wally Flannenbaum
DD13   Victor Zenfliende
...

Some of the player’s names are difficult to spell correctly, even if you are familiar with them.  Code Replacement makes this problem a thing of the past.  All you have to do is get the spelling right once: during the creation of the Code Replacement text file.  Once you have created your text file, you need to tell Photo Mechanic to use it for Code Replacement.  Open the Preferences dialog and click on the IPTC/XMP tab.  Then click on the ‘Code Replacement’ button.  A small dialogue will open that will explain briefly what ‘Code Replacement’ is.  This dialogue has a ‘Choose...’ button on it which will allow you to load your text file.  Once your text file is loaded, you can use ‘Code Replacement’ to speed up your captioning.

Continuing our basketball example, lets say you shoot a game where the Chattanooga Choo-Choos play the Detroit Dunkers.  Later after Ingesting your images you begin to individually caption the keepers and want to identify the players in each of the photos.  Example: you have a picture with Dain Bramage (CC8) breaking past Stanislav Zarubezhanin (DD41) and you can visibly see their jersey numbers in the thumbnail preview of the IPTC Info dialog.  You just type in your codes for each player, surrounded by the ‘\’ character which tells Photo Mechanic to look up the codes and enter their replacements.  Photo Mechanic instantly looks up the replacement text and enters it in place of the \code\ and automatically places the cursor at the end of the replacement so that you can continue typing in the rest of your text.
Code Replacement can help make your captions more accurate and can save time as well: just choose a system of mnemonics to help you remember your codes and the pictures themselves will help you derive the codes.  In our example we chose CC as an abbreviation for the ‘Chattanooga Choo-Choos’ and DD as an abbreviation for the ‘Detroit Dunkers’.  When captioning, we can see that the two players are on the Choo-Choos and the Dunkers, so we can derive the codes from their jersey numbers (8 and 41), giving us CC8 and DD41.

[there would be a graphic here showing Code Replacement in action]

Code Replacement can be used anytime you have commonly entered terms that you tire of entering each time.  Code Replacement works in every text field of the IPTC Info and IPTC Stationery dialogues.

HTH,

-Kirk

Offline jdemott

  • Newcomer
  • *
  • Posts: 11
    • View Profile
Re: Code Replacement HOW-TO
« Reply #2 on: May 02, 2006, 08:00:28 PM »
Thanks so much Kirk, exactly what I was looking for.

-Jason

Offline jdemott

  • Newcomer
  • *
  • Posts: 11
    • View Profile
Re: Code Replacement HOW-TO
« Reply #3 on: May 04, 2006, 06:08:07 PM »
After much grepping/scripting, I've compiled a .txt file for all MLB teams as well as an all-inclusive .txt file w/ all teams.  Not sure if anyone would like or not, if there's any interest I'll post the zip file.  They're taken from the 40-man roster on each official mlb team's site and are current as of today.

Thanks,

Jason

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Code Replacement HOW-TO
« Reply #4 on: May 04, 2006, 06:21:37 PM »
After much grepping/scripting, I've compiled a .txt file for all MLB teams as well as an all-inclusive .txt file w/ all teams.  Not sure if anyone would like or not, if there's any interest I'll post the zip file.  They're taken from the 40-man roster on each official mlb team's site and are current as of today.

What do your codes look like?
Have you tried using Code Replacement with one of your assignments?  What did you think?

Thanks,

-Kirk

Offline jdemott

  • Newcomer
  • *
  • Posts: 11
    • View Profile
Re: Code Replacement HOW-TO
« Reply #5 on: May 04, 2006, 07:20:13 PM »
Kirk,

Codes use the MLB city abbreviations and look like this:

wsh36   Tony Armas
wsh34   Pedro Astacio
wsh56   Luis Ayala
wsh57   Jason Bergmann
wsh32   Chad Cordero
wsh27   Zach Day
wsh45   Ryan Drese
wsh58   Joey Eischen


I've used them and they're great.  I've just gotten a suggestion to expand on it a bit to have something like:

wsh36   Washington Nationals pitcher, Tony Armas, #36

Sounds like a good idea to me, waiting on more suggestions before I start tweaking on them.

Thanks again,

-Jason

Offline dbrouse

  • Full Member
  • ***
  • Posts: 190
    • View Profile
    • DC Corporate Headshots
Re: Code Replacement HOW-TO
« Reply #6 on: May 06, 2006, 12:41:53 AM »
TEST



[attachment deleted by admin]
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
WNBA-Wahington Mystics (Code Replacement File)
« Reply #7 on: May 06, 2006, 12:52:20 AM »
WNBA-Wahington Mystics (updated 5/6/2006)

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

Offline Ron Scheffler

  • Newcomer
  • *
  • Posts: 21
    • View Profile
Re: Code Replacement HOW-TO
« Reply #8 on: May 06, 2006, 12:28:35 PM »
MLB is great because all of the rosters are in a first name last name format. Looking at various NFL teams, it appears they're all last name, first name order. Is there a way to flip the order so it appears as first name last name (and get rid of the comma)? I mean, a way that would save having to do each one manually...
Ron Scheffler - Photographer

Offline dbrouse

  • Full Member
  • ***
  • Posts: 190
    • View Profile
    • DC Corporate Headshots
Re: Code Replacement HOW-TO
« Reply #9 on: May 06, 2006, 02:01:05 PM »
Ron...thats easy...do you have the COMPLETE NFL roster available (I haven't looked)?

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

Offline Ron Scheffler

  • Newcomer
  • *
  • Posts: 21
    • View Profile
Re: Code Replacement HOW-TO
« Reply #10 on: May 06, 2006, 05:47:05 PM »
No, I'm just thinking ahead. Does a complete roster exist somewhere publicly accessible?

The NFL will be a good example of keeping on top of personnel changes since the training camp rosters vs. preseason vs. regular season will differ considerably.

If it's so easy, how does one do it (switch the naming order)?
Ron Scheffler - Photographer

Offline dbrouse

  • Full Member
  • ***
  • Posts: 190
    • View Profile
    • DC Corporate Headshots
Re: Code Replacement HOW-TO
« Reply #11 on: May 06, 2006, 06:35:26 PM »
First, you can jsut replace the comma with a blank. The the function I would use in excel is "concatenate" . Use the help inside Excel or look here:
http://www.techonthenet.com/excel/formulas/concat.php

The hardest part is the cut/paste portion. If you can give me the file, I'll gladly do the rest.  I just dont want to go to 32 (???) website to grab the information.

training camp rosters vs. preseason vs. regular season will differ, with more duplicate numbers for those undrafted rookies and stuff like that.  But again..it's as simple as mkaing the change for the teams you're working with that game. 
Delane B. Rouse/Rouse Photography Group, LLC
Mac OS: Version 10.7.4, Build 12713

Offline Pixel

  • Newcomer
  • *
  • Posts: 30
    • View Profile
Re: Code Replacement HOW-TO
« Reply #12 on: May 08, 2006, 07:02:02 PM »
Kirk-
When I type in a code the appropriate name comes up as expected BUT there is a backslash at the end that has to be manually deleted, is this a bug? It's just one extra step that I'd like to eliminate.
Thanks

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Code Replacement HOW-TO
« Reply #13 on: May 08, 2006, 07:17:39 PM »
When I type in a code the appropriate name comes up as expected BUT there is a backslash at the end that has to be manually deleted, is this a bug? It's just one extra step that I'd like to eliminate.

It shouldn't be there after the replacement.  What OS platform are you running on?  Can you reproduce the problem with a simple Code Replacement file (one that has just a couple of entries?)

Anything that you can think of that will help me reproduce the problem would be much appreciated.

Thanks,

-Kirk

Offline Pixel

  • Newcomer
  • *
  • Posts: 30
    • View Profile
Re: Code Replacement HOW-TO
« Reply #14 on: May 08, 2006, 07:56:35 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.