Import from Text File into Menu/List Item

I would like a menu/list item on a form layout to display a bespoke list of 2 letter country codes. I have the country codes I want in a text file on disk.

Is there any way of importing the list from the text file into the menu/list item, without needing to create each listitem manually from within the inspector for the menu/list?

Each two letter code needs to be an item in the menu/list, for both the “Choice” and “Value”.

If there is no in-built import function in Freeway, is there a 3rd party Action that might do this?

Thanks very much for any help.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You could modify my County List action - or if you want to email me I could do it for you.

http://www.deltadesign.co/fw_examples/countylist.html

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Dear DeltaDave,

Thanks very much for the pointer. I shall take a look and see whether I can modify the action.

Regards,

Chong-Yee


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The other thing you can do is use a text editor to change the list of codes into a select. In TextWrangler (the free cousin of BBEdit) or BBEdit, open your list of codes, and make sure that all you have is a list of one country code per line, no other spaces or text.

Open the Find dialog with Command-F, and check the “Grep” checkbox. In the top box type this:

(.+)

in the bottom box type this:

<option value="1">1</option>

Press Replace all. Now you have the “guts” of your select list. At the top of the text file, type a return, left arrow to get back to the first line, and add this:

<select name="country" size="1">

Arrow down to the end of the list and add the closing tag. Now copy all of this text and switch back to Freeway. Place your text cursor where you want the select list to appear, and choose Edit / Paste HTML from the main menu. Your list will appear in Freeway as a native Freeway picking list, with all of the controls you would ordinarily have in the Inspector (move the items around, make one the default, etc.).

This is really quick to do – it took me longer to type the directions than it would to actually do it, and I type really fast. Find and Replace is a powerful tool in BBEdit/TextWrangler – almost a programming language unto itself. If you don’t have one of these applications in your toolbox, I really recommend you get one.

Walter

On Sep 10, 2012, at 3:48 AM, Chong-Yee Khoo wrote:

Dear DeltaDave,

Thanks very much for the pointer. I shall take a look and see whether I can modify the action.

Regards,

Chong-Yee


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 10 Sep 2012, 3:15 pm, waltd wrote:

The other thing you can do is use a text editor to change the list of codes into a select. In TextWrangler (the free cousin of BBEdit) or BBEdit, open your list of codes, and make sure that all you have is a list of one country code per line, no other spaces or text.

Thank you very much for the suggestion, Walter - you’re a star. I didn’t realise you could do this with Freeway. I did my first website coding HTML by hand in 1995 so will give it a shot!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks for sharing that Walter but just to clarify

Edit>Paste HTML

should read

Edit>Paste Markup

That is a feature of FW that I have never used before!

And here it is http://www.deltadesign.co/fw_examples/other/custompicker.html set to default to GMT

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options