• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Strange Errors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange Errors


  • Subject: Re: Strange Errors
  • From: Yvan KOENIG <email@hidden>
  • Date: Mon, 10 Aug 2015 19:45:09 +0200

I made few changes to what I posted and it seems to work.

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
set theWIP to WanIP() # EDITED
display alert "Your IP Address is " & theWIP & " And has been copied to your clipboard." # EDITED
set the clipboard to theWIP # EDITED
else if the button_pressed is "PingIPOrDomainName" then
set IP_address to ""
set dialog_1 to display dialog "Enter IP Address:" default answer "" with title "Ping IP Address" 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
else
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 quit?" buttons {"FileBugReport", "VisitApplicationWebSite", "Quit"} cancel button "Quit"
set the button_pressed to the button returned of the result
#Buttons
if the button_pressed is "VisitApplicationWebSite" then
set VisitApplicationWebSite to "http://firestar-hosting.com/mac"
open location VisitApplicationWebSite
else
if the button_pressed is "FileBugReport" then
set FileBugReport to "http://firestar-hosting.com/mac/bugs"
open location FileBugReport
end if
end if
end if

on WanIP()
set WIP to missing value
set siteList to {"http://checkip.dyndns.org/", "http://whatismyip.com", "http://www.whatismyipaddress.com", "http://ipid.shat.net/", "http://www.edpsciences.comhtbin/ipaddress", "http://www.showmyip.com/"}
repeat with thissite in siteList
try
set WIP to item 1 of paragraphs of (do shell script "curl " & thissite & " | tr -cs '[0-9\\.]' '\\012' | awk -F'.' 'NF==4 && $1>0 && $1<256 && $2<256 && $3<256 && $4<256 && !/\\.\\./'")
if WIP is not missing value then exit repeat
end try
end repeat
return WIP
end WanIP


Yvan KOENIG (VALLAURIS, France) lundi 10 août 2015 19:44:54



 _______________________________________________
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

References: 
 >Strange Errors (From: Daniel Chavez <email@hidden>)
 >Re: Strange Errors (From: Yvan KOENIG <email@hidden>)

  • Prev by Date: Re: Strange Errors
  • Next by Date: Script Utilizing an Alternate Printer
  • Previous by thread: Re: Strange Errors
  • Next by thread: Re: Strange Errors
  • Index(es):
    • Date
    • Thread