5 Replies Latest reply: Oct 12, 2012 10:54 AM by Pierre L.
watson101 Level 1 Level 1 (0 points)

Im pretty new to Apple script

 

I am using the

scutil --get LocalHostName

scutil --get HostName

 

to Check that the Local host name and host name of a machine are the same if they arent i want to set the localhost name to the host.

 

Heres what i have so far

tell application "Terminal"

  activate

          set localHostName to ""

          set hostName to ""

 

          set currentTab to do script "scutil --get LocalHostName"

  currentTab = localHostName                                                       //pretty sure these lines are capturing anything from terminal

 

     do script "scutil --get HostName" in currentTab

  currentTab = hostName

 

          if hostName is not equal to localHostName then

                    set currentTab to do script "scutil --set HostName/ " & localHostName & " /"

          end if

 

 

 

end tell

 

 

any help would be most apprieciated


OS X Mountain Lion (10.8.2)