Alright, so I have my Mac Pro and Macbook Pro here at college, and a company called Apogee provides internet service. Problem is, whenever I switch computers, it requires me to re-authenticate with Apogee using my username/password. This is saved so all I have to do is click through, but after authenticating, it requires that you RESTART your computer before the connection works.
This is very, very annoying, so I've figured that simply going into System Preferences, clicking "Ethernet 2" (or whatever you're using to connect), making it inactive, hitting apply, then making it active again and hitting apply again gets it on the move without a restart.
The question is: How do I get this to happen in Applescript? I'm extremely unfamiliar with the workings of it, but so far I love how simple the commands are. Unfortunately the task I'm trying to do is a little over my head for a first time script. Some googling has gotten me this far:
tell application "System Preferences" to reveal anchor "Ethernet" of pane "Network"
Which opens the correct ethernet anchor on the left panel. But, how does it know which one I want? I have Ethernet 1 and Ethernet 2 in that panel, this code seems to always go to what I want it to, but how does it know if the command is simply "Ethernet"?
More importantly, what do I do next? Sorry for being a braindead newbie at this, but I'm really not sure how to progress. I need it to click the "gear" button at the bottom of the pane, click "make service inactive," then "apply", then the same gear menu again, "make service active," then "apply" once more, and then quit System Prefs.
Is this possible? Thanks a ton for your time,
fs454
:edit: also, I'm using Snow Leopard 10.6.1
This is very, very annoying, so I've figured that simply going into System Preferences, clicking "Ethernet 2" (or whatever you're using to connect), making it inactive, hitting apply, then making it active again and hitting apply again gets it on the move without a restart.
The question is: How do I get this to happen in Applescript? I'm extremely unfamiliar with the workings of it, but so far I love how simple the commands are. Unfortunately the task I'm trying to do is a little over my head for a first time script. Some googling has gotten me this far:
tell application "System Preferences" to reveal anchor "Ethernet" of pane "Network"
Which opens the correct ethernet anchor on the left panel. But, how does it know which one I want? I have Ethernet 1 and Ethernet 2 in that panel, this code seems to always go to what I want it to, but how does it know if the command is simply "Ethernet"?
More importantly, what do I do next? Sorry for being a braindead newbie at this, but I'm really not sure how to progress. I need it to click the "gear" button at the bottom of the pane, click "make service inactive," then "apply", then the same gear menu again, "make service active," then "apply" once more, and then quit System Prefs.
Is this possible? Thanks a ton for your time,
fs454
:edit: also, I'm using Snow Leopard 10.6.1