• 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: Key Code For Option Key
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Key Code For Option Key


  • Subject: Re: Key Code For Option Key
  • From: Bill Cheeseman <email@hidden>
  • Date: Wed, 12 Mar 2008 16:13:02 -0400
  • Thread-topic: Key Code For Option Key

on 2008-03-12 1:21 PM, Thomas Maffucci at email@hidden wrote:

> I assume to turn mouse keys off I would have to do the following:
>
> tell application "System Preferences"
>     activate
>     set current pane to pane id "com.apple.preference.universalaccess"
> end tell
>
> tell application "System Events"
>     tell process "System Preferences"
>         tell tab group 1 of window 1
>             click radio button 4
>             if value of checkbox 2 is 0 then
>                 click checkbox 2
>             end if
>         end tell
>     end tell
> end tell
>
> quit application "System Preferences"

No.

The checkbox should keep the same index number. The index is always 1 for
this checkbox, not 2, in the current version of System Preferences. You
could have used its name, instead, but in this case its name is rather long.

And, if you want to turn it off, you should check whether its 'value' is
currently 1, not 0. The 'value' attribute of a checkbox is an integer
representing a boolean value, 0 for false, 1 for true. So you want to click
it -- to turn it off -- only if the value is currently 1 (true, or checked).
(If it value were currently 0 (false, or unchecked), clicking it would be a
mistake because that would turn it on, whereas you want it to be off.)

So to turn it off when it is currently on, change your lines in the middle
to this:

             if value of checkbox 1 is 1 then
                 click checkbox 1
             end if

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
www.quecheesoftware.com

PreFab Software - www.prefabsoftware.com


 _______________________________________________
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

References: 
 >Re: Key Code For Option Key (From: Thomas Maffucci <email@hidden>)

  • Prev by Date: Re: Key Code For Option Key
  • Next by Date: Accessing lasts characters of a string
  • Previous by thread: Re: Key Code For Option Key
  • Next by thread: Applescript Language Guide for Leopard
  • Index(es):
    • Date
    • Thread