Skip to content

Commit f14329a

Browse files
author
Yoni Samlan
committed
OS X 10.11 update
* Toggle Function Keys for Snow-Yosemite. * Disabled scripting brings you to the new home for the UI element scripting toggle, under Security. * Use system notifications instead of Growl, getting us up to date with 2012's hot new OS X features.
1 parent 2828545 commit f14329a

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

README.markdown

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
Toggle Function Keys for OS X (10.6)
1+
Toggle Function Keys for OS X (10.11)
22
==============
33

4-
This is a modified version of an AppleScript from [Macsteps](http://macsteps.com/blog/tips/how-to-quickly-toggle-your-keyboards-function-keys/), updated to support OS X 10.6 and to put up a Growl notification with the new status. There's also a Download available bundled as a shiny application, so no fancy script menu nonsense is necessary - just run the app.
4+
This is a modified version of an AppleScript from [Macsteps](http://macsteps.com/blog/tips/how-to-quickly-toggle-your-keyboards-function-keys/),
5+
updated to support OS X 10.11 and to put up a system notification so you know
6+
what state the keys are in.
57

6-
This will only work in English at the moment due to its reliance on GUI scripting.
8+
A signed app-ified version of this script is coming soon; in the meantime, to
9+
get an easily-run binary, open the script file and choose "File -> Export" with
10+
File Format of "App."
11+
12+
Note that this will only work in English at the moment due to its reliance on
13+
GUI scripting.
14+
15+
This (in theory) should work on any OS X 10.8+ English Mac - I've only tested
16+
the latest version against OS X 10.11, though, so feel free to fork/PR if you
17+
run into any issues on other versions of OS X.

Toggle Function Keys.applescript

+3-16
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,15 @@ tell application "System Events"
1717
set messageToShow to messageToShow & "media/hardware controls."
1818
end if
1919

20-
tell application "GrowlHelperApp"
21-
-- Make a list of all the notification types
22-
-- that this script will ever send:
23-
set the allNotificationsList to {"Function Keys Toggled"}
24-
-- Make a list of the notifications
25-
-- that will be enabled by default.
26-
-- Those not enabled by default can be enabled later
27-
-- in the 'Applications' tab of the growl prefpane.
28-
set the enabledNotificationsList to {"Function Keys Toggled"}
29-
-- Register our script with growl.
30-
register as application "Toggle Function Keys" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "Script Editor"
31-
-- Send a Notification...
32-
notify with name "Function Keys Toggled" title "Function Keys Toggled" description messageToShow application name "Toggle Function Keys"
33-
end tell
20+
display notification messageToShow
3421
end tell
3522
tell application "System Preferences" to quit
3623
else
3724
-- GUI scripting not enabled. Display an alert
3825
tell application "System Preferences"
3926
activate
40-
set current pane to pane "com.apple.preference.universalaccess"
41-
display dialog "UI element scripting is not enabled. Please activate \"Enable access for assistive devices\""
27+
set current pane to pane "com.apple.preference.security"
28+
display dialog "UI element scripting is not enabled. Please activate this app under Privacy -> Accessibility so it can access the settings it needs."
4229
end tell
4330
end if
4431
end tell

0 commit comments

Comments
 (0)