result = []
repeat with n = 1 to numDraws
thisDraw = random(count(li))
result.add(text.line[thisDraw])
li.deleteAt(thisDraw)
if count(li) < 1 then exit repeat -- just to be sure, in
case you want to draw more lines, than are in the text :-)
end repeat

> Thank you for your help!
>
> One other issuse... so now I have a list of three items.
I need to
output
> them back into a text member like this:
> Item 1, Item2, Item3
>
> The trick, I guess is on the last item, not to put a ","
after it... so
> there would only be a "," between items 1 & 2
>
> Thanks again for your help!

You'll probably want to put it into a loop or something,
though I don't know
exactly what your situation is. Just make sure your
itemDelimiter is set to
",". It is by default, but if you've changed it for some
reason, it will
use whatever you changed it to.

------------
on getRandomLines theText,numDraws,newTextMember
-- empty the new text member...
member(newTextMember).text = ""
-- an empty list to hold a sequential list of numbers...
li = []
-- an empty list to temporarily hold the strings that are
picked from
the first text member...
newList = []
-- get the total number of lines to work with
numLines = member(theText).line.count
-- build a list of the line numbers that can be used...
repeat with n = 1 to numLines
li.add(member(theText).line[n])
end repeat
-- test to be sure that you are using a legal number of
items to pull
out...
if numDraws <= numLines then
-- loop to grab the number of lines of text that you want
repeat with n = numDraws down to 1
-- pick a random number from the list of line numbers...
thisDraw = random(li.count)
-- add that line of text to the list
newList.add(li[thisDraw])
-- remove that number from the list...
li.deleteOne(thisDraw)
end repeat
-- loop through the grabbed lines of text and place them in
a new
text member with spaces in between
repeat with n = 1 to numDraws-1
member(newTextMember).text = member(newTextMember).text
&
newList[n] & Space
end repeat
-- add the last line
member(newTextMember).text = member(newTextMember).text
&
newList[numDraws]
-- clear the temporary list
newList = []
else
-- show an alert if you've entered a bad number for
numDraws...
alert("too many lines to retrieve")
end if
end
-------