Script to get Internet Connect to set configuration and dial

I’ve been reading the archives about ways to script Internet Connect to dial, and ways to add dialing configurations, but I haven’t seen an example of how to do both at the same time. What I need to do is:

  1. Add a new modem configuration, as an example, let’s call it “My_ISP”
  2. Add a phone #, accountname, and password to that configuration
  3. tell Internet connect to “connect” using that newly added configuration

I did manage to find the below script which does a great job if the configuration is already added and available, but it doesn’t do the above.

I’m assuming that if the above works, that if I were to then manually go into the Internet Connect application, and pull down the “Configuration” pull-down menu, that I’d then have this new configuration visible as an option from then on out.

Is my understanding of all this modem setup stuff correct? You need a configuration first, and then you are allowed to dial via Applescript? Would this work on all Mac OS 10.1 and above?

Any guidance is GREATLY appreciated.


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

I am afraid I can’t really help - adding configurations has been troublesome ever since the days of Mac OS 9. (Here, I used the venerable “TCP/IP config” scripting addition that did not make the transition to OSX and has never been reliable in the first place)

You could try to use the “Internet Connect” dictionary


connect to telephone number [Unicode text]
 		[as user Unicode text] 
 		[with password Unicode text] 


but it does NOT save your configuration.

You could try that with GUI scripting (query Versiontracker for an application called “UI Browser”) and manage all the steps and Aqua interface elements that define phone strings etc. but you have to incorporate a lot of error conditions that may appear and I doubt if the result will really serve your needs.

Yup, I tried that technique first, and soon discovered that it wouldn’t dial unless I had a configuration added first. However, I don’t want the user to have to do this configuring - - - I just want the applescript to dial the modem and connect to the server on it’s own. Surely someone on this list has accomplished this???