Re: list coersion...
Re: list coersion...
- Subject: Re: list coersion...
- From: Gary Lists <email@hidden>
- Date: Tue, 10 Jun 2003 17:05:51 -0400
On or about 6/10/03 3:20 PM, Paul Skinner wrote:
>
On Tuesday, June 10, 2003, at 02:32 PM, Gary Lists wrote:
>
>
> On or about 6/10/03 1:01 PM, John Tuttle wrote:
>
>
>
>> I have a script which pulls the contents of a value list from
>
>> FileMaker
>
>> Pro as a string.
>
>>
>
>> The resulting string is in the following format:
>
>>
>
>> "item1\ritem2\ritem3\ritem4"
>
>>
>
>> I can't seem to get this into a form that Applescript can understand
>
>> as
>
>> a list with multiple items.
>
>>
>
>> All I can coax is a list with one item "item1\ritem2\ritem3\ritem4".
>
>>
>
>> I am trying to get a list of 4 items.
>
>>
>
>> Any suggestions?
>
>> --
>
>> John Tuttle
>
>
>
> This statement:
>
> set fmVL to "item1\ritem2\ritem3\ritem4"
>
>
>
>
>
> -- Compiles to:
>
> set fmVL to "item1
>
> item2
>
> item3
>
> item4"
>
>
This was also pointed out by Michelle Steiner, but in context of the
>
question the OP posted, the script would assign the value from FMP to a
>
variable. This would leave the slashed-r return characters in the text.
>
>
Paul
It doesn't matter which you use as the TID. Either "\r" or the word return
will work.
It should be noted that there needs to be different logic to get a list
from:
a. a non-repeating field but with multiple value list items (as in
checkboxes)
b. a repeating field with multiple entries.
Here are two examples, tested FM 5.5 and FM 6.0.1.
TEST 1: Repeating Field, Multiple Items
-- repeating field with multiple items
--
set rep to cell "repFLD" of current record
choose from list rep
--> works, b/c repeating fields return lists of their items
-- including blanks, if the repetitions are separated, such as:
-- "one","two","","four" if the third rep is empty
TEST 2: Non-Repeating Field, Multiple Items from Value List
-- non repeating field, but with multiple Value List items
--
set norep to cell "norepFLD" of current record
display dialog norep
-- includes returns, displays okay
choose from list norep
-- one big chunk, not a list...
-- AS makes a list with 1 item to display in choose box
-- but its not what you want
-- use /r as delim
set text item delimiters to "\r"
set norepList to text items of norep
choose from list norepList
-- works, now its a list
-- use return as delim
set text item delimiters to return
set norepListReturn to text items of norep
choose from list norepListReturn
-- also works, now a list
HTH
--
Gary
MacOS 9.1 / "9 is Fine"
OMM: osa:AS 183 / osa:JS 103 / FM 55 / BB601 / Smile 188
______________________________________________________________
Please reply directly to the list.
Incoming messages are auto-deleted. (It's anti-spam, that's all.)
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.