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:
- Add a new modem configuration, as an example, let’s call it “My_ISP”
- Add a phone #, accountname, and password to that configuration
- 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