• 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: Converting a nested list to return delimited string with TIDs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting a nested list to return delimited string with TIDs


  • Subject: Re: Converting a nested list to return delimited string with TIDs
  • From: Ehsan Saffari <email@hidden>
  • Date: Thu, 7 Jun 2001 12:32:22 -0600

On 07/06/2001 7:57, Paul Berkowitz <email@hidden> wrote:

>To get what you want - separate strings on separate lines -- is not, I
>think, possible within AppleScript itself. That puts the "lines" out of the
>domain of normal AppleScript, since the return character is also a string,
>so concatenating it to any of the other strings is going to make it all into
>one string as above. I'm very curious as to how you got that AppleScript
>result in a repeat loop, if that's what you meant. Can you demonstrate?

The orioginal list comes from FileMaker:

tell app "FMP" to set daList to every record of current layout of
document 1
-->{{cell1,cell2,... ,celln},{cell1,cell2,... ,celln},{cell1,cell2,...
,celln}}

(each sublist is a db record, number of fields depends on the current
layout)

in a double nested loop I parsed it out to the desired format as I showed
above
The code runs inside FMP and the result is written to file, no editor
involved. But I suspected that TIDs may be a better solution, so I came
here ;>

Here's the final item (thanks to all who responded, specially Paul And
Olivier)

set x to every record of current layout of document 1
set {TIDs, AppleScript's text item delimiters} to ,
{AppleScript's text item delimiters, return}
repeat with y from 1 to length of x
set item y of x to (item y of x as text) & return
end repeat
set {z, AppleScript's text item delimiters} to {x as text, TIDs}
--write it out

cheers
ehsan
(digester)


  • Prev by Date: Re: Dropping text on to Droplets
  • Next by Date: Re: text manipulation
  • Previous by thread: RE: Converting a nested list to return delimited string with TIDs
  • Next by thread: Re: Converting a nested list to return delimited string with TIDs
  • Index(es):
    • Date
    • Thread