write result of modem string to scrolling text box

Hello,
As a total novice I’ve managed using the excellent tutorials and examples to compile the following applescript in Applescript Studio in Xcode 2.2.1 in mac os x 10.4.11.
However my script fails at

set end of sms_show to {"SMS #: " & nummer & return & timmy} as string

It doesn’t write to the NSscroll view element it throws an error
"
Can’t set end of "SMS #:07944059872
"to "SMS #: 07944059872

1129
NMBR". (-10006)

I’m sure this is some basic noob error I’ve been methodically reading through all the related posts and theirs lots along similar line but no one has been so kind as to divulge their solutions in such depth that a total novice like my self would be able to follow.

on awake from nib theObject
	
	set portRef to serialport open "/dev/cu.pci-serial1"
	
	set sms_show to {}
	repeat
		repeat
			-- the rest of your script
			set xstr to "at+vcid=" & "1" & return
			serialport write xstr to portRef
			delay 1
			set read_numb to serialport read portRef
			
			
			
			if read_numb does not contain "MESG" then exit repeat
			
			set tid to AppleScript's text item delimiters
			set AppleScript's text item delimiters to {space} -- again, quotes escaped
			set nummer to text item 9 of read_numb
			set AppleScript's text item delimiters to tid
			
			set tid to AppleScript's text item delimiters
			set AppleScript's text item delimiters to {space} -- again, quotes escaped
			set timmy to text item 7 of read_numb
			set AppleScript's text item delimiters to tid
			
			
			set sms_show to "SMS #: " & nummer & return as string
			set end of sms_show to {"SMS #: " & nummer & return & timmy} as string
			
		end repeat
	end repeat
	
	set ASTID to AppleScript's text item delimiters
	set AppleScript's text item delimiters to {return}
	set sms_show to sms_show as Unicode text
	set AppleScript's text item delimiters to ASTID
	
	set content of text view "text" of scroll view "scrolltext" of tab view item "tab1" of tab view "tab" of window "main" to sms_show
	
end awake from nib

Hi,

sms_show is defined as a list, but you set it in the repeat loop to a string.

What is the second repeat loop for?
The exit repeat command will exit the inner loop but never leave the outer loop.

I removed also the not needed text item delimiters
Try this


on awake from nib theObject
	
	set portRef to serialport open "/dev/cu.pci-serial1"
	set tid to AppleScript's text item delimiters
	set sms_show to {}
	repeat
		-- repeat
			-- the rest of your script
			set xstr to "at+vcid=" & "1" & return
			serialport write xstr to portRef
			delay 1
			set read_numb to serialport read portRef
			
			if read_numb does not contain "MESG" then exit repeat
			
			set AppleScript's text item delimiters to space -- quotes escaped
			set nummer to text item 9 of read_numb
			set timmy to text item 7 of read_numb
			set AppleScript's text item delimiters to {""}
			
			-- set sms_show to "SMS #: " & nummer & return as string
			set end of sms_show to "SMS #: " & nummer & return & timmy
			
		-- end repeat
	end repeat
	
	set AppleScript's text item delimiters to return
	set sms_show to sms_show as Unicode text
	set AppleScript's text item delimiters to tid
	
	set content of text view "text" of scroll view "scrolltext" of tab view item "tab1" of tab view "tab" of window "main" to sms_show
	
end awake from nib