• 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
Re: Opening System Preference Panes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opening System Preference Panes


  • Subject: Re: Opening System Preference Panes
  • From: "Neal A. Crocker" <email@hidden>
  • Date: Fri, 30 Aug 2002 16:44:56 -0700

Neil,

Thanks. That did the trick. Now I see the "hint" in the dictionary that suggests that syntax. Do you know if there is a way to write to set preferences from AppleScript (i.e., turn handwriting recognition on/off)?

For that, you need to use the "do shell script" command (in Standard Additions) to use the "defaults" shell command. The shell command "defaults" let you access a more-or-less system-wide database of preferences that includes the settings controlled by the System Preferences. Setting can be written into the database for any domain using key-value pairs, so you'll need to know what domain to refer to, the appropriate key for you setting and the values it takes. The domain for any give preference pane is of the form "com.apple.preferences.xxx", where xxx depends on the preference pane your are interested in. You should recognise this form, by the way, since the applescript

tell application "System Preferences" to get name of panes

returns a list of strings of this form corresponding to the names of each pane. Each name is actually the domain name you need.

As for how to discover what key and value to use, you can open Terminal.app and expermiment with defaults shell command (which incidentally lets you read out the keys and values for any domain to the terminal window) while changing settings in the System Preferences pane of your choice. Sometimes, valid keys don't exist in the database, leaving the preference pane to use some hardwired default value, but by changing thing the System Preferences pane, you ought to be able to make any key controllable there show up in the terminal. To find out the command syntax for the "defaults" command, type "man defaults" (without the quotes) into a terminal window and hit return.

Neal.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: AppleScript Try
  • Next by Date: Please comment on Mail to Spamcop script...
  • Previous by thread: Re: Opening System Preference Panes
  • Next by thread: Re: Opening System Preference Panes
  • Index(es):
    • Date
    • Thread