Connecting to the internet (via Modem)

Hi everyone! I have a little question about connecting to the internet via modem (using the current preferences and connection settings)

How could I connect using “Internet connect” and avoiding a


.
.
.
tell app "Internet connect" 
        connect -- this will work, but opening the anoying "Internet Connect" window
end tell
.
.
.

since this opens the whole program and I would like it to work like when I just click connect in the upper-right menu where the little phone is, hehe

Thanks a lot!

Oh, forgot a little something, :rolleyes: ha, it’d great if I new how to disconnect later, without pulling the cord, hehe! Of course, again without opening “Internet Connect”

The final point is to log the time when I connect and then again when disconnecting so I can control the time I spend on the net. I pretty much got that, but it’s still full of “crashy” things. Ok, thanks!!

Nikel, take a look at this thread. There’s some hints available for you…

http://bbs.applescript.net/viewtopic.php?t=3404&highlight=internet

Thanks Greg. but I couldn’t make it to connect without openning “Internet Connect”. I mean, I got the script to connect, but then again, openning a not wanted window.
And BTW


connect using "my_conection" to tel num "XXX" user name "X" password "X"
(I think it was like this)

Didn’t work, it compiled an everything, but when run, just did nothing!

Dan Decker published a code in “Code Exchange” arround april or so, if I remember correctly, with some things about connecting, but that wasn’t useful either.
Maybe it just ain’t possible! It’s not that terrible anyway, for me, but I’m designing it so that “not familiar with mac (or computers at all)” users can connect without having lots of things going around, and can connect with the push of a button (and acording to the script they choose perform different tasks os something like that. Let´s say my grandma wants to send me a message to my mobile phone).

Ok, one more thing, does anyone now how to keep a dialog open until something happens? kinda like “Procesing…” until the script finishes it’s duties. Does SE have something like that?

See you around!

Hi Nikel,

You can quit Internet Connect at the end of your tell block, and the computer should remain connected.


tell the current application
	display dialog "Do you wish to Connect or Disconnect from the Internet?" buttons {"Cancel", "Connect", "Disconnect"} default button "Connect"
	set the requested_status to the button returned of the result
end tell

if the requested_status is not "Cancel" then
	tell application "Internet Connect"
		activate
		set configName to "Internal Modem"
		set currentStatus to status of configuration configName
		if the requested_status is "Connect" then
			connect configuration "Internal Modem"
		else if the requested_status is "Disconnect" then
			disconnect configuration configName
		end if
		quit
	end tell
end if