"Can't get text return of" error

Hello, i have written this script to set the ip address, subnet, router, dns, and search domain across locations from user input. However I am getting an error in the the line that concatenates the imput. any help would be very appreciated.

set ipaddress to display dialog "Enter IP Address and Router when prompted " buttons {"OK"}
set ipaddress to display dialog "Enter IP Address" default answer "1.1.1.1"
set ipaddress to text returned of ipaddress
set subnet to "255.255.224.0"
set router to display dialog "Enter Router" default answer "1.1.1.1"
set router to text returned of router
set network to text returned of {ipaddress & space & subnet & space & router}
set dns to "205.137.240.5 205.137.241.66"
set dns to text returned of dns
tell application "System Events"
	do shell script "scselect School\\ AP"
	do shell script "networksetup -setmanual Airport " & network
	do shell script "networksetup -setdnsservers Airport " & dns
	do shell script "networksetup -setserchdomain Airport scsk12.org"
	do shell script "scselect School\\ EN"
	do shell script "networksetup -setmanual Ethernet " & network
	do shell script "networksetup -setdnsservers Ethernet " & dns
	do shell script "networksetup -setserchdomain Ethernet scsk12.org"
end tell


and the error

error "Can't get text returned of {\"1.1.1.1 255.255.224.0 1.1.1.1\"}." number -1728 from text returned of {"1.1.1.1 255.255.224.0 1.1.1.1"}

Model: macbook
AppleScript: 2.1.1
Browser: Firefox 3.6.8
Operating System: Mac OS X (10.6)

These lines don’t make sense…

set network to text returned of {ipaddress & space & subnet & space & router}
set dns to "205.137.240.5 205.137.241.66"
set dns to text returned of dns

“text returned” is only something you get from a dialog box and they don’t come from dialog boxes. Just remove “text returned of”. You have other problems too but that is the reason for your error.

I think you should do some learning first. Here’s a list of tutorials: http://macscripter.net/viewtopic.php?id=25631. I suggest the ones titled “AppleScript Tutorial for Beginners”.

Thank you I fixed the errors and it is working now.