9.1. Internet ConnectIf you connect to the Internet using a dial-up modem or an AirPort wireless card, Internet Connect is your best friend. Located in your Applications folder, Internet Connect lets you connect and disconnect to the Internet at will. And if you're having connection problems, Internet Connect can help by showing you how strong your wireless signal is. Even better, Internet Connect is 100% scriptable. If you want to automate your connecting, the Internet Connect/AppleScript combo makes it a cinch. 9.1.1. Dialing Up to the InternetDial-up connections, while only a fraction the speed of DSL or cable, have a number of unique advantages. For one thing, dial-up is much cheaperabout 20% the cost of a high-speed connection, in many areas. For another, dial-up connections are available everywherea major advantage if you happen to live in Guam. Plus, you can access a dial-up connection even when traveling, as long as there's a phone jack where you're going. The best part about a dial-up connection, however, is that you can create an AppleScript to automatically connect you to the Internet, wherever and whenever you want. Here's how:
set thePhoneNumber to the text returned of (display dialog ¬ "Please enter the phone number to connect to:" default answer "") set theUsername to the text returned of (display dialog ¬ "Please enter your username:" default answer "") set thePassword to the text returned of (display dialog ¬ "Please enter your password:" default answer "") tell application "Internet Connect" --This is the part that actually connects: connect to telephone number thePhoneNumber as user theUsername ¬ with password thePassword end tell Using a series of three dialog boxes (Figure 9-1), that script is all you need to dial up to the Internet.
9.1.2. Finding AirPort Signal StrengthSurfing the Internet wirelessly is great, but it's got some annoying requirements. First, you need a wireless card to insert into your Mac. Next, you need a wireless base stationa small device that broadcasts your Internet connection throughout your house or apartment. Finally, you have to be within range of the base stationusually a few hundred feetto pick up the wireless signal on your Mac. The trouble is, if you have a laptop, the signal strength changes as you move around. Taking the computer from your kitchen to your basement, for example, could make the signal twice as weak. Of course, the weaker your signal is, the slower you'll be able to connect to the Internet, so you should find the part of your house that has the best signal. Like so many other tasks, AppleScript makes this quite easy. Simply run the following script, and you'll get a dialog box whenever your signal is exceptionally strongor exceptionally weakas you walk around your house: --Part 1: tell application "Internet Connect" set strongestSignalSoFar to the signal level of AirPort configuration 1 set weakestSignalSoFar to the signal level of AirPort configuration 1 end tell --Part 2: repeat delay 3 --Part 3: tell application "Internet Connect" set currentSignal to the signal level of AirPort configuration 1 end tell --Part 4: if currentSignal > strongestSignalSoFar then
display dialog "You're getting the strongest signal so far: " ¬ & currentSignal & "%" set strongestSignalSoFar to currentSignal --Part 5: else if currentSignal < weakestSignalSoFar then display dialog "You're getting the weakest signal so far: " & currentSignal & "%" set weakestSignalSoFar to currentSignal end if end repeat Here's how the script works:
Run the script, and then start walking around your house. As you go from room to room, you'll notice your signal strength fluctuate. Once you find a room with a strong signal (ideally 60% or higher), you can sit down and surf the Web, confident that you're not losing speed to poor reception.
|