Are there any way to replace MacIfMon with own made AppleScripts? I would like Leopard to inform my AppleScript when computer has working network connection or when it drops it because bad AirPort.
Same way i would like to monitor when apps are launched or crashed in real time. I know i could get every 60 seconds list of all processes, but i need more real time solution.
The only way I can think is to run a curl command. If the curl command executes without an error then your network connection is good… if there’s an error then the connection is down.
try
do shell script "curl http://www.apple.com"
-- connection is good
on error
-- connection is bad
end try
monitoring services with AppleScript is always expensive, because AppleScript is not able to
use any callback functions like notifications or delegate methods as Objective-C is able to