I have and apple script that renames a computer the first time someone logs in. Everything is working, but because my name is Dagel, Rich it is only naming the computer Dagel, and losses the Rich. Any ideas.
tell application "System Events" to get name of current user
set shortName to result
tell application "System Events" to get full name of current user
set longName to result
do shell script "sudo scutil --set LocalHostName " & quoted form of shortName user name "Admin" password "word" with administrator privileges
do shell script "sudo scutil --set ComputerName " & longName user name "Admin" password "word" with administrator privileges