• 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
Having trouble setting the Network Location
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Having trouble setting the Network Location


  • Subject: Having trouble setting the Network Location
  • From: Richard Cross <email@hidden>
  • Date: Tue, 14 Apr 2009 21:54:17 +0100

I'm just starting out with AppleScript and have been having some problems with one of the example scripts at http://www.apple.com/applescript/features/system-prefs.html.

The script to change Network location reads as follows:

tell application "System Events"
 tell network preferences
 get properties
 --> returns: {current location:location id "51BD3FB7-50D1-4859-9649-9138E7FF1ECA" of network preferences, class:network preferences object}
 get the name of every location
 --> returns: {"Automatic", "Sprint Card"}
 set current location to location "Automatic"
 end tell
end tell

Unfortunately, this fails to change my network location to Automatic (if it's set to anything else).  I tried substituting "Automatic" with the names of my other network locations - still no joy.

Have I missed something?  If I run the scselect command from terminal, I can change network location no problem.

Regards,

Richard Cross 
 _______________________________________________
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: GUI scripting Flash (julifos)
  • Next by Date: Copy to list Question
  • Previous by thread: Re: GUI scripting Flash (julifos)
  • Next by thread: Copy to list Question
  • Index(es):
    • Date
    • Thread