インターネット接続をチェック

on testNetConnection
   if HostNameToAddress("www.yahoo.com") is not empty then
      hilite button "Connected" of stack "Transcription Processor"
   else
      unhilite button "Connected" of stack "Transcription Processor"
   end if
end testNetConnection

Windowsのshellを使う。

function checkNetStatus
-- hide shell activity from user
set the hideConsoleWindows to true

-- ping a host that should always
-- visible to your computer
get shell("ping 24.10.72.1 -n 1 -w 200")

-- isolate the status info
put lineoffset("% loss",it) into x
set the itemDelimiter to "="
get word 1 of last item of line x of it

-- tell somebody!
if it <> 1 then
return "UP"
else
return "DOWN"
end if
end checkNetStatus