Automatic Disconnect from ISP

I would like to have an automatic disconnect from my ISP when I no longer have any browsers and newsreaders and such open. The Remote Access control panel isn’t scriptable. Is there another way to accomplish this? Better yet, is there a script out there that already does what I want?

the ARA control panel has embedded in it this feature. You can determine how many minutes it must wait when there is no user interaction before disconnect ISP connection and you can choose for a notification or not.

I’m aware of the ability to set such a time-out. What I want is for a automatic disconnection to be made the instant there are no longer any applications open that call for a TCP/IP connection, just like (Oh how I hate to say this!) it happens in Windows.

In the AppleScript Guidebook help module (if you don’t have it you can get it free of charges from the official Apple web site) is described the scripting procedure with handlers to control ARA connections. You need only to write a script that monitor (in a on idle statement) the state of the affairs (browser is open, user interact with computer or not, and so on) and make the appropriate actions.

Nigel, many thanks for putting me on the right track. I was able to somewhat simplify the script you suggested, and it appears that this simplified version is doing exactly what I wanted it to do – disconnect remote access whenever none of the designated applications is running. Below is the revised script.

property myInternetApps : {"Internet Explorer 4.5", "Netscape Communicator™", "Outlook Express"}
on idle
tell application "Finder"
get (first process whose name is in myInternetApps) as list
end tell
if the result is {} and the state of (RA status) is "Connected" then
RA disconnect
end if
return 30
end idle

James L. Ryan