Passing multiple variables to shell from Applescript
I'm trying to run an applescript that takes user input and pass it to a shell script. It is only passing one of the variables for the final results.
Here's the Applescript I'm using
delay 5
tell me to activate
display dialog "Please enter the following information."
property RoomNumber : ""
display dialog "Enter the room number and building (ie 1312CAC):" default answer RoomNumber
set the RoomNumber to text returned of the result
property StationNumber : ""
display dialog "Enter the Station Number:" default answer StationNumber
set the StationNumber to text returned of the result
do shell script ("echo " & RoomNumber & ";" & StationNumber & " | /Users/labadmin/Desktop/labbuild.sh")
and here is the shell script:
#!/bin/sh
RoomNumber="$1"
StationNumber="$2"
compname=$RoomNumber$StationNumber
echo $compname
scutil --set ComputerName $compname
scutil --set HostName $compname
scutil --set LocalHostName $compname
echo "Done setting the computer name"
It will echo both variables, but the shell is only taking one for the final result.
Can anyone see what I may have done wrong?
Thank you!!!
G5, Mac OS X (10.4.6)