• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Turn on/off Internet sharing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Turn on/off Internet sharing


  • Subject: Turn on/off Internet sharing
  • From: Romanski Piotr <email@hidden>
  • Date: Wed, 28 Jan 2009 08:17:22 +0100

Hi

I'm new in Applescript and want to write script which turn on and off my Internet Connection sharing. So I wrote something like this:
-----BEGIN------


tell application "System Preferences" to set current pane to pane "com.apple.preferences.sharing"
tell application "System Events" to tell process "System Preferences"

if value of checkbox 1 of row 10 of table 1 of scroll area 1 of group 1 of window "Sharing" is 0 then
click checkbox 1 of row 10 of table 1 of scroll area 1 of group 1 of window "Sharing"
else
if value of checkbox 1 of row 10 of table 1 of scroll area 1 of group 1 of window "Sharing" is 1 then
click checkbox 1 of row 10 of table 1 of scroll area 1 of group 1 of window "Sharing"
delay 1
tell application "System Preferences" to quit
end if
end if
end tell


----- END ------

Turn off Connection Sharing works fine - it's start System Preferences, turn on Conncection Sharing and quit System Preferences.

But if I try to turn on Connection Sharing there is window appear with message something like (I have Polish OS X so forgive me inaccurate translation): Are you sure want to turn on internet connection sharing. with 2 buttons: Run (Start) and Cancel.

And now... How to write further part of my script which click Run (start) button and quit System Preferences panel?

Thanks for any advices
Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Prev by Date: RE: Changes in osascript?
  • Next by Date: How do I create a Applescript Interface for my Application
  • Previous by thread: Re: Changes in osascript?
  • Next by thread: How do I create a Applescript Interface for my Application
  • Index(es):
    • Date
    • Thread