can't get the text returned from multi-dialog

I am using a mult-dialog script to get a list of information, but I am having trouble getting each line of the result to put into a text box in InDesign. I’ve included my event log info, which tells me I am, in fact getting the first line of the dialog’s user input, “1” but it’s not plugging it into the “TextLabel” text box in my InDesign file. (I am using “1”, “2”, “3”, “4”, “5” in my test, but the real answers will be words, not numbers, but it won’t grab the words either, so numbers are quicker to insert for testing)
At the bottom of my code I have a test dialog box surrounded with “(*” and" *)" which, when activated works, so I know the TextLabel text box is found, so there is something wrong with how I am naming the info returned from the multi-dialog box.

[code]set ASTID to AppleScript’s text item delimiters

on multi_dialog for q given listing:l
tell q as list
set {a, b, c} to {{}, beginning, count}
set v to b’s class is integer
if v then set {c, v, q} to {b, b is 0, rest}
end tell
if v then set c to 30
repeat c times
set a’s end to “”
end repeat
set {d, text item delimiters} to {text item delimiters, return}
set {q, a, text item delimiters} to {q as string, a as string, d}
set r to (display dialog q default answer a)'s text returned
if (count r) is not 0 then
if not v then tell r & a
if l then return paragraphs 1 thru c
return text 1 thru paragraph c
end tell
tell r to repeat with i from (count paragraphs) to 1 by -1
if (count paragraph i) is not 0 then
if l then return paragraphs 1 thru i
return text 1 thru paragraph i
end if
end repeat
end if
if l then return {}
“”
end multi_dialog
set inset_answer to (multi_dialog for {5, “Teaser items, list either 4 or 5:”} with listing)
set l to inset_answer
set b to {} as list
repeat with a in l
if class of a is not integer then
set b’s end to a as list
end if
end repeat
log (class of b)
set AppleScript’s text item delimiters to ASTID

tell application “Finder”
activate
open document file “Leave-Behind template.indd” of folder “*Listings” of folder “Cheryls Folder” of folder “File Storage” of startup disk
end tell
tell application “InDesign CS”
if exists document 1 then
tell document 1
set userInputA to b
set teaseA to userInputA
set theTeaseA to teaseA
set tease1 to first text item of theTeaseA
search “TeaserLabel” for “abcd” replacing with tease1

		(*set userInput4 to display dialog "City" default answer "Type Here"
		set ansrD to text returned of userInput4
		set theAnsr4 to ansrD
		set ansr4 to first text item of theAnsr4
		search "TeaserLabel" for "abcd" replacing with ansr4*)
	end tell
end if

end tell[/code]
This is what my event log tells me

tell current application display dialog "Teaser items, list either 4 or 5:" default answer " " {text returned:"1 2 3 4 5", button returned:"OK"} (*list*) end tell tell application "Finder" activate open document file "Leave-Behind template.indd" of folder "*Listings" of folder "Cheryls Folder" of folder "File Storage" of startup disk end tell tell application "InDesign CS" exists document 1 true search "TeaserLabel" for "abcd" replacing with {"1"} "InDesign CS got an error: \"TeaserLabel\" doesn't understand the search message."

Let me simplify my question. How do I get the list of items returned of a multi_dialog box, given that each line may contain two or three words?

Hi,

Why don’t you use the choose from list feature of AppleScript

set a to {"1", "2", "3", "4", "5"}
set b to choose from list a  with prompt "Choose something:"
if b is false then return -- if the user has pressed the Cancel button
set b to item 1 of b

or

set a to {"1", "2", "3", "4", "5"}
set b to choose from list a with prompt "Choose something:" with multiple selections allowed
if b is false then return -- if the user has pressed the Cancel button

That would work, except the list of all the possibilities the user could choose from would be hundreds. The user is being asked to choose the top four or five features of a home they want to highlight, such as:

Swimming Pool
Fireplace
3 Car Garage
Jacuzzi
3 Bathrooms

It would be better if the user came up with the four or five and gave me those answers. What I need is to be able to get each answer and place it in a teaser headline in an InDesign file in this manner, “¢ Swimming Pool ¢ Fireplace ¢ 3 Car Garage ¢ Jacuzzi ¢ 3 Bathrooms”, which I can do. I just need to get the information that is returned from the multi_Dialog box. So far, I have been unsuccessful.

I have used a regular dialog box, in which the information is returned as “Swimming Pool, Fireplace, 3 Car Garage, Jacuzzi, 3 Bathrooms”, but then I can’t get “Swimming Pool”, I get “Swimming”, “Pool”, as if there were 9 features instead of 5.

two suggestions

set a to "Swimming Pool
Fireplace
3 Car Garage
Jacuzzi
3 Bathrooms"
set b to paragraphs of a
--> {"Swimming Pool", "Fireplace", "3 Car Garage", "Jacuzzi", "3 Bathrooms"}

or

set a to "Swimming Pool, Fireplace, 3 Car Garage, Jacuzzi, 3 Bathrooms"
set {TID, text item delimiters} to {text item delimiters, ", "}
set b to text items of a
set text item delimiters to TID
b
--> {"Swimming Pool", "Fireplace", "3 Car Garage", "Jacuzzi", "3 Bathrooms"}

Paragraphs! Thank you, thank you , thank you. Paragraphs, that solved the dilemna. I didn’t know what to call it.