?
Solved

Apple Script and check boxes

Posted on 2014-10-29
6
Medium Priority
?
800 Views
Last Modified: 2014-11-04
I have tried everything that I can think of to check a check box in Apple Script. I am trying to enable Full Keyboard Shortcuts. I know there are Terminal command but when I have been playing around with them they don't work. So, I just want to do this via Apple Script. I have a script written to open up System Preferences and then go to Keyboard. I need to enable "Use all F1, F2, etc. keys as standard keys" then I can handle the rest. I have been working on this for a bit and reaching out here as a last hope I have tried everything. Thank you for your assistance. I am just starting to learning this platform. Just trying to check this checkbox in AppleScript
0
Comment
Question by:Kevin Portell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 10

Expert Comment

by:EdTechy
ID: 40411509
0
 

Author Comment

by:Kevin Portell
ID: 40411546
I found those links and tried the second one. I am going to be running this one multiple computers so the first one isn't an option.  I even tried hacking some code together with Automator to no avail. I have created:
tell application "System Preferences"
	activate
	delay 1
	tell application "System Events" to keystroke "Keyboard"
	delay 1
	tell application "System Events" to keystroke return
	delay 3
	tell application "System Events" to tell process "Keyboard"
		set theCheckbox to checkbox "Use all F1, F2, etc. keys as standard function keys / When this option is selected, press the Fn key to use the special features printed on each key." of sheet 1 of window 1
		tell theCheckbox
			if not (1) then click theCheckbox
		end tell
	end tell
	delay 10
	tell application "System Events" to keystroke "q" using {command down}
end tell

Open in new window



However, it's doesn't work all the way. Could you assist me in ironing it out? Am I missing something or completely FUBARing it?
0
 

Author Comment

by:Kevin Portell
ID: 40411681
I think I am getting closer. I am getting the error:
Script Error
System Events got an error: Can't get sheet 1 of windows 1 of process "System Preferences. Invalid index.
Any thoughts?
0
RHCE - Red Hat OpenStack Prep Course

This course will provide in-depth training so that students who currently hold the EX200 & EX210 certifications can sit for the EX310 exam. Students will learn how to deploy & manage a full Red Hat environment with Ceph block storage, & integrate Ceph into other OpenStack service

 
LVL 10

Assisted Solution

by:EdTechy
EdTechy earned 600 total points
ID: 40413189
Sorry, I have played with it but I am a much better Googler than scripter. I do think you will have to have assistive device services enabled before your Apple script will work as per the first post.
0
 

Accepted Solution

by:
Kevin Portell earned 0 total points
ID: 40414296
So, I had a bit of code together and got a functioning piece.
tell application "System Preferences"
	activate
	reveal anchor "keyboardTab" of pane "com.apple.preference.keyboard"
end tell
delay 1
tell application "System Events" to tell process "System Preferences"
	click checkbox 1 of tab group 1 of window 1
delay 1
tell application "System Events" to keystroke "q" using {command down}
end tell

Open in new window

0
 

Author Closing Comment

by:Kevin Portell
ID: 40421200
I am sure there is a better way and would like little discussion of best practices.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you looking to clear some space on your phone for the latest iOS 8 update? Did you switch to Spotify so you no longer need to keep music native on your phone? Run out of space for taking photos while in the middle of vacation? Sometimes the quic…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question