Re: How do you display the IP Address?
Re: How do you display the IP Address?
- Subject: Re: How do you display the IP Address?
- From: Emmanuel LEVY <email@hidden>
- Date: Wed, 26 Aug 2009 01:37:07 +0200
Restricting to the (local) IP address question, OMM I have to do : do
shell script "ipconfig getifaddr en1" since do shell script "ipconfig
getifaddr en0" fails, so my script reads:
on whoami()
try
return do shell script "ipconfig getifaddr en0"
end try
try
return do shell script "ipconfig getifaddr en1"
end try
end
Emmanuel
On Aug 25, 2009, at 10:57 PM, email@hidden wrote:
I am so close to having this work, I think. I'm back with latest
version of the "Help Desk Script" and need some input. I added
running a shell script command which does return the correct IP
address in Terminal or AppleScript if ran by itself. The question is
how to I identify the answer and display it with the other values?
Thanks for all the great input on this!
set macInfo to system info
set macName to computer name of macInfo
do shell script "ipconfig getifaddr en0"
set userName to long user name of macInfo
set userlocale to user locale of macInfo
set homeDirectory to home directory of macInfo
set bootvolume to boot volume of macInfo
set primaryEthernetAddress to primary Ethernet address of macInfo
set CPUtype to CPU type of macInfo
set CPUspeed to CPU speed of macInfo
set Physicalmemory to physical memory of macInfo
set homeDirecory to home directory of macInfo
set networkInfo to do shell script "/usr/sbin/system_profiler
SPNetworkDataType" -- get network info
set AppleScript's text item delimiters to {"Domain Name:"}
try (* get rid of unavailable domain *)
set macDomainName to paragraph 1 of text item 2 of networkInfo
on error
set macDomainName to "unknown"
end try
set AppleScript's text item delimiters to {" "}
set userInfo to {}
set the end of userInfo to {"~RRD HELP DESK INFORMATION~"}
set the end of userInfo to {"Computer Name: ", macName} as text
set the end of userInfo to {"IP Address", en0} as text
set the end of userInfo to {"Network Domain: ", macDomainName} as text
set the end of userInfo to {"User Name: ", userName} as text
set the end of userInfo to {"User Location:", userlocale} as text
set the end of userInfo to {"Home Directory:", homeDirectory} as text
set the end of userInfo to {"Boot Volume:", bootvolume} as text
set the end of userInfo to {"MAC Address:", primaryEthernetAddress}
as text
set the end of userInfo to {"CPU Type:", CPUtype} as text
set the end of userInfo to {"CPU Speed:", CPUspeed} as text
set the end of userInfo to {"Memory:", Physicalmemory} as text
set AppleScript's text item delimiters to return & return
set user_info to userInfo as text (* required to get rid of a
confusion upon 'as *)
display alert user_info
_______________________________________________________________________________________________________
Jeffrey W. Madson | Macintosh Systems Engineer | RR Donnelley
Desktop Engineering
W6545 Quality Drive | Greenville, WI 54942 | (: 920-997-3768 | Cell:
920-915-8619 | *: email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden