I want to be able to let a user know if they've not put in a host name, that the box is empty. The catch would be, if they selected ping by accident, and they just pressed enter to try and exit, it would say something like, no host or ip detected, do you wish to continue?
If yes, it will bring them back to the ping input dialog, if not, it should go to the final application dialog.
else if the button_pressed is "PingIPOrDomainName" then
set IP_address to ""
set dialog_1 to display dialog "Enter IP Address or domain name:" default answer "" with title "Ping IP Address or domain" buttons {"OK"} default button 1
set the IP_address to the text returned of dialog_1
try
do shell script ("ping -c 2 " & IP_address)
display dialog "Host is up" buttons {"OK"} default button 1 with title "Host Status"
on error
display dialog "Host unreachable" buttons {"OK"} default button 1 with title "Host Status"
end try
end if
display alert "Thank you for using this application. If you liked using this application, please consider donating by visiting the application website and clicking on donate. Any amount donated would be greatly appreciated. Would you like to file a bug report? Visit the main application website? Or exit?" buttons {"FileBugReport", "VisitApplicationWebSite", "Exit"} cancel button "Exit"
set the button_pressed to the button returned of the result
#Buttons
if the button_pressed is "VisitApplicationWebSite" then
open location VisitApplicationWebSite
else
if the button_pressed is "FileBugReport" then
open location FileBugReport
end if
end if