How do you display the IP Address?
How do you display the IP Address?
- Subject: How do you display the IP Address?
- From: email@hidden
- Date: Tue, 25 Aug 2009 15:57:02 -0500
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden