Author Topic: Postal code state abbreviation variable?  (Read 3801 times)

Offline Pixel

  • Newcomer
  • *
  • Posts: 30
    • View Profile
Postal code state abbreviation variable?
« on: November 09, 2010, 07:55:05 AM »
I can't find the variable code for a postal code abbreviation for states? The only variable I see is the one that writes out the entire state name, I just want the postal code abbreviation.
Is there one? Do I create one myself?
Never done this.
Thanks!

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24767
    • View Profile
    • Camera Bits, Inc.
Re: Postal code state abbreviation variable?
« Reply #1 on: November 09, 2010, 08:23:30 AM »
I can't find the variable code for a postal code abbreviation for states? The only variable I see is the one that writes out the entire state name, I just want the postal code abbreviation.
Is there one? Do I create one myself?

No there isn't one.  You can't create your own variables.  But you can use Code Replacement to lookup the long state name and replace with the short one.

Example Code Replacement text file:

Alabama[tab]AL
Alaska[tab]AK
Arizona[tab]AZ
Arkansas[tab]AS
California[tab]CA
...
Wyoming[tab]WY

You'd load that file into the 'Set Code Replacement' dialog.  Later when you want the short state and your IPTC State is set, you'd enter the following:

\{state}\

Which would cause a lookup of the {state} variable as a Code and would replace with the Replacement value.

HTH,

-Kirk

Offline Pixel

  • Newcomer
  • *
  • Posts: 30
    • View Profile
Re: Postal code state abbreviation variable?
« Reply #2 on: November 09, 2010, 08:39:33 AM »
Considering all the various variations of everything else, I'm baffled postal code state abbreviations wasn't included?
Any chance you can add that to the next revision?

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24767
    • View Profile
    • Camera Bits, Inc.
Re: Postal code state abbreviation variable?
« Reply #3 on: November 09, 2010, 08:43:27 AM »
Considering all the various variations of everything else, I'm baffled postal code state abbreviations wasn't included?
Any chance you can add that to the next revision?

No.  Where are they supposed to come from? The EXIF data in the photo doesn't contain the state.  It is entered by you: in the IPTC dialog there is a place to enter the state.  If you want to enter CA instead of California, go ahead.  Then the {state} variable will evaluate to CA.

There are so many different countries in the world with different conventions for naming that it would be difficult to come up with a system that would work for everyone.

-Kirk

Offline Pixel

  • Newcomer
  • *
  • Posts: 30
    • View Profile
Re: Postal code state abbreviation variable?
« Reply #4 on: November 09, 2010, 08:46:44 AM »
My problem is my agency wants the state spelled out in the state dialog box but they want it abbreviated to the postal code in the caption box!

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24767
    • View Profile
    • Camera Bits, Inc.
Re: Postal code state abbreviation variable?
« Reply #5 on: November 09, 2010, 08:51:13 AM »
My problem is my agency wants the state spelled out in the state dialog box but they want it abbreviated to the postal code in the caption box!

I've given you a solution.  Use Code Replacement.  You can even use it with the application of the IPTC Stationery Pad to do the work for you in a matter of moments.

-Kirk