• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Filemaker Value List into Applescript list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Filemaker Value List into Applescript list


  • Subject: Re: Filemaker Value List into Applescript list
  • From: email@hidden
  • Date: Tue, 6 Feb 2001 23:52:33 EST

In a message dated 2/6/01 12:43:48 PM, another Jeff wrote:

>in Filemaker...
>
>I'm using a calculation field to get all items in a value list
>(ValueListItems).
>
>In Applescript...
>
>I'm attempting to set a variable as a list from the value list items in the
>calculation field in Filemaker.
>
>My result is a concatenated string of the value list items. How can I
>separate the value list items so they are listed properly in Applescript?

This is a job for powersplit. If your value list looks like

valueA&valueB&valueC

then use (watch line breaks)

set valuesAsList to powersplit(valueList,{"&"})

on powersplit(src, delimList)
if length of delimList is equal to 1 then
set srcAsList to {}
try
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to (item 1 of
delimList) as string
set srcAsList to (text items of src) as list
set AppleScript's text item delimiters to oldDelims
on error
set AppleScript's text item delimiters to oldDelims
end try
return srcAsList
else
set linesAsList to {}
set srcAsList to my powersplit(src, (item 1 of delimList) as
string)
repeat with aLine in srcAsList
set aLineAsList to my powersplit(aLine, (rest of delimList))
copy aLineAsList to end of linesAsList
end repeat
return linesAsList
end if
end powersplit

Powersplit is recursive, so multiple levels of splitting can be achieved
easily, for example:

set listOfLists to powersplit(concatenatedSrcTxt,{return,"&","="})

Have fun.

Jeff Baumann
email@hidden
www.linkedresources.com

History is interesting. An apple fell on Newton's head and he invented
Calculus, while Bill Gates invented Windows and got a pie in the face.


  • Prev by Date: Re: Scripting Eudora
  • Next by Date: Re: Re: run-only applets/dropplets
  • Previous by thread: Re: Filemaker Value List into Applescript list
  • Next by thread: run-only
  • Index(es):
    • Date
    • Thread