I do a loop on a existing list.
there are multiple returns and I want to create a new list of those returns
for example:
set my_list to {"abc", "defg", "hia", "jklmno"}
repeat with i from 1 to count of my_list
set MyItem to item i of my_list
if MyItem contains "a" then
display dialog " " & MyItem & " "
end if
end repeat
set my_list to {"abc", "defg", "hia", "jklmno"}
set newList to {}
repeat with i from 1 to count of my_list
set MyItem to item i of my_list
if MyItem contains "a" then
copy MyItem to end of newList
end if
end repeat
set my_list to {"abc", "defg", "hia", "jklmno"}
set newList to {}
repeat with i in my_list
set MyItem to i as text
if MyItem contains "a" then
copy MyItem to end of newList
end if
end repeat
set oldtid to AppleScript's text item delimiters
set AppleScript's text item delimiters to ", "
display dialog " " & newList as text
set AppleScript's text item delimiters to oldtid
return newList
essentially means “as string”, because that command’s leftmost item determines the result’s class; your item is a space”an empty string. The second space at the end isn’t actually doing anything.