Skip to main content
August 9, 2019
Question

Automatically generate an abbreviation from one field to another

  • August 9, 2019
  • 2 replies
  • 695 views

I have a long drop down list of countries in one field and i want to generate an automatic abbreviation for those counties in another field

for example if I choose France from the drop down field, i want the other field to automatically show FRA,

and if i choose Kuwait from the drop down, i want the other field to show KWT and so on...

This topic has been closed for replies.

2 replies

August 9, 2019

does anyone know a simple script that can generate that??

try67
Community Expert
August 9, 2019

Once you apply the export values as Bernd described you can use a simple script to copy the selected value to the text field.

If the drop-down is called Countries you can use this as the custom calculation code of the text field:

event.value = this.getField("Countries").valueAsString;

The values themselves can also be applied using a script, like this:

this.getField("Countries").setItems([["Kuwait", "KWT"], ["United States", "USA"]]);

If you already have the names and codes in a text file or spreadsheet then you can use this (paid-for) tool I've developed to easily import everything at once, without having to write any code yourself: Custom-made Adobe Scripts: Acrobat -- Import Items from a Text File to a Combo-Box or List Field

Bernd Alheit
Community Expert
August 9, 2019

In the dropdown list use the abbreviations as export values. Then you can use the selected value in the other field.

August 9, 2019

can you please further explain what you said, i am veryyy new to adobe

Bernd Alheit
Community Expert
August 9, 2019

In the properties of the dropdown list you can assign the export values to entries of the list.