#Ask the user to select a network option
display alert "What would you like to do" message "Select a network option" buttons {"RetrieveYourIP", "PingIPOrDomainName", "Quit"} cancel button "Quit"
set the button_pressed to the button returned of the result
#Buttons
if the button_pressed is "RetrieveYourIP" then
say "Retrieving Your IP address, this may take a moment." without waiting until completion
display alert "Your IP Address is " & return & return & ipaddress() & return & return & " and has been copied to your clipboard."
end if
#IP Definitions
on ipaddress()
end ipaddress
#CheckIP function for internet check code
to chkUP(theURL)
return (count (get ((theURL as URL)'s host & {dotted decimal form:""})'s dotted decimal form)) > 0
end chkUP