Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A short script to automate dial-up internet connections Internet
This is a hint for all those poor people out there who still have dial up at home, like me. This isn't much of anything just a little something for those lazy people. Using a key editor, I suggest iKey), create a script like this:
  tell application "internet connect"
    (connect)/(disconnect)
  end tell
Using iKey, set the key to launch this script to whatever you want -- I used the Command-F13. When pushed, it automatically connects to the internet for you. The only problem I have found is that it opens the application Internet Connect. If you're like me, and don't like a bunch of applications open in the dock that are pretty useless, it's kind of irritating. Maybe someone could find the command for the little phone thingy in the status bar. That way it wouldn't open anyhting.

[robg adds: I don't have a dial-up account to test this with, but I would think adding "quit" just above the "end tell" would connect to the net and then quit the Internet Connect app -- that's just a guess, though...]
    •    
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[8,415 views]  

A short script to automate dial-up internet connections | 5 comments | Create New Account
Click here to return to the 'A short script to automate dial-up internet connections' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Rob's right
Authored by: jecwobble on May 22, '03 12:10:02PM
Here's what I have in iKey:
tell application "Internet Connect"
   set configName to "Internal Modem"
   set currentStatus to status of configuration configName
   if state of currentStatus is 0 then
      connect configuration "Internal Modem"
      tell application "Safari"
         activate
      end tell
      tell application "Mail"
         activate
      end tell
   else
      if state of currentStatus is 4 then disconnect configuration configName
   end if
   quit
end tell


[ Reply to This | # ]
You can do it via ssh too
Authored by: a1291762 on May 22, '03 06:46:22PM

With one caveat, you can do the same thing while ssh'd into your machine. The caveat is that Applescript doesn't wait for Internet Connect to open so if it's not running the script will fail the first time.

I used this for a while to connect to the net from an iBook plugged into my iMac which did the actual dialing. I've since setup a PC running Unix to be my internet dialer so I've got a somewhat different setup. It's a client/server app that lets me start/stop and monitor the connection.

I can post it if anyone's interested. It's written for a FreeBSD machine using usermode PPP as the "server" but it's tweakable. The "server" process is written in TCL, and the Client is a mix of Java, Applescript and Cocoa.



[ Reply to This | # ]
A short script to automate dial-up internet connections
Authored by: calroth on May 23, '03 08:27:48AM

Save the script as "connect".

In a shell, sleep 15000 ; open ./connect ; sleep 15000 ; open ./connect etc.

If you've got a session limit on your dialup account (of, let's say, 15000 seconds), the above script will keep your connection up. There are probably better ways of achieving this.



[ Reply to This | # ]
A short script to automate dial-up internet connections
Authored by: d_n_i_elle on May 24, '03 12:11:53PM

Under the password box in Internet Connect, there is a checkbox that says "Show Modem Status in menu bar". Click that, and it will show in your menu bar, and you can also connect, disconnect, or open the Internet Connect Application from that menu bar without opening the original application.



[ Reply to This | # ]
tell internet connect to quit
Authored by: redfood on May 31, '03 03:15:09AM
This answers the question left open in the original hint.

If you don't like internet connect in the dock just have it quit. It doesn't need to be open in order to maintain the modem connection.

[ Reply to This | # ]