• 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: changing keyboard shortcut check boxes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing keyboard shortcut check boxes


  • Subject: Re: changing keyboard shortcut check boxes
  • From: kai <email@hidden>
  • Date: Mon, 31 Oct 2005 21:59:54 +0000


On 31 Oct 2005, at 17:22, email@hidden wrote:

Hi! I am trying to turn off some keyboard shortcuts if they have been selected and I am having a problem where my code seems to only turn off the check box of whatever row is currently highlighted. I am looping through each row checking for the "Keyboard Navigation" line. However, if last I had the "Input Menu" line highlighted for example and it is currently turned ON, that one seems to be the one that is turned OFF. Is there something I am missing to highlight the line I want before clicking the check box, or something wrong with my code to click on the correct check box? I am running OS 10.4.2, AppleScript 1.10, and ScriptEditor 2.1.

Not much about this sort of stuff is that obvious or intuitive, Jennifer - so don't feel too bad about it. :-)


In fact, you're already very close. Your observation about the click affecting the highlighted row is spot on - as is your question about how to select the required row. You can achieve the latter in one or two ways - perhaps most directly by using the 'select' command.

A couple of other minor points. It's not essential to explicitly activate System Preferences to perform operations like this (unless you prefer to - or need to for some other purpose). Neither is it strictly necessary to loop through each row to identify the required one - since you could filter it instead:

----------------

tell application "System Preferences" to set current pane to pane "com.apple.preference.keyboard"
tell application "System Events" to tell process "System Preferences" to tell tab group 1 of window 1
click radio button "Keyboard Shortcuts"
tell outline 1 of scroll area 1
tell (first row whose value of text field 1 is "Keyboard Navigation")
if value of checkbox 1 is 1 then
select
click checkbox 1
end if
end tell
end tell
end tell


----------------

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >changing keyboard shortcut check boxes (From: "email@hidden" <email@hidden>)

  • Prev by Date: Re: for a living (Applescript-users Digest, Vol 2, Issue 725)
  • Next by Date: Window Processes Running....
  • Previous by thread: changing keyboard shortcut check boxes
  • Next by thread: Rsync reliability?
  • Index(es):
    • Date
    • Thread