Newbie questions about modifying a script.
Newbie questions about modifying a script.
- Subject: Newbie questions about modifying a script.
- From: email@hidden
- Date: Fri, 7 Aug 2009 13:03:58 -0500
Good Afternoon,
I am totally new to AppleScript and
need some assistance/advice on a script I'm trying to develop. I want to
end up with a Application in the Dock or Menu Bar Item that will display
the Computer Name, IP Address, Domain and User Name of the Mac Work Station
in a window on the desktop. I have started experimenting with the following
script but have not been able to figure out how to modify it correctly.
The problems are: 1) It only puts a file on the desktop which would work
but a window that disappears after selecting OK would be better. 2) The
report has way to much information for what I need because it is just pointing
to the Apple System Profiler Info. but I can't figure out how to query
just the information I need. 3) The beginning of the script seems to generate
a "Current External IP Address" which is not necessary nor do
I know what that is. I don't understand why there is a web address or what
it does in the script.
This would eventually be used by phone
support to assist with any Mac issue in order to supply them with basic
support information so the user doesn't have to go looking for it. Any
help would be greatly appreciated.
property
TheLocation
:
"~/Desktop/System\\ Info.txt"
--
properly escaped POSIX path for the text file
tell
(current
date)
as
«class
isot»
as
string
to
set
TheDate
to
text
1
thru
10
&
space
&
text
12
thru
16
set
TheTitle
to
"Computer Information "
&
TheDate
&
return
&
return
do shell script
"curl http://checkip.dyndns.org"
--
get IP address
if
the
result
is
not
""
and
the
result
contains
"Current IP Address:"
then
set
ExternalIP
to
return
&
" Current External
IP Address: " &
word
-7
of
the
result
&
return
else
set
ExternalIP
to
return
&
" Current External
IP Address: -unknown-"
&
return
end
if
do shell script
"/usr/sbin/system_profiler
SPSoftwareDataType" --
get system software info
set
Software
to
(text
((offset
of
":"
in
result)
+
7)
thru
-1
of
result)
&
return
do shell script
"/usr/sbin/system_profiler
SPHardwareDataType" --
get hardware info
set
Hardware
to
(text
((offset
of
":"
in
result)
+
7)
thru
-1
of
result)
&
return
do shell script
"/usr/sbin/system_profiler
SPNetworkDataType" --
get network info
set
Network
to
"Network Overview:"
&
return
&
ExternalIP
&
(text
((offset
of
":"
in
result)
+
2)
thru
-1
of
result)
do shell script
"echo "
&
¬
quoted
form of
TheTitle
&
¬
quoted
form of
Software
&
¬
quoted
form of
Hardware
&
¬
quoted
form of
Network
&
¬
"
> " &
TheLocation
_______________________________________________________________________________________________________
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