jkbrzt / macos-fn-toggle

A macOS app to quickly toggle the behavior of the fn key.

Home Page:https://twitter.com/jakubroztocil

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

not working in macOS Sierra

kevindashgit opened this issue · comments

OSX v10.12.6

Probably this is assumed w/ the fancy new touch bar and the complexity it introduces - but a fn key toggle would be AWESOME for my workflow!

Any known workarounds?

It seems to be working for me. What exactly is the issue you're facing? It's even working on High Sierra for me.

When I attempt to run it I get the error (in a dialog window) The action "Run AppleScript" encountered an error.

Oh I got this too when I upgraded to Sierra. Just delete the current binary you have, re-download and follow the installation steps again, it'll start working.

hmmm - I tried this but no luck.

git pull && make clean && make install && ./fn-toggle.app/Contents/MacOS/Application\ Stub

yields both the error dialog mentioned above along w/ the following output in stdout:

2017-10-02 13:02:42.974 Application Stub[78836:2812651] Cache file at /System/Library/Caches/com.apple.automator.actionCache-system-readonly.plist is not valid: System Languages have changed.
2017-10-02 13:02:42.974 Application Stub[78836:2812651] Failed to use read-only system cache from installer at /System/Library/Caches/com.apple.automator.actionCache-system-readonly.plist.

Actually . - now that I look more closely at the automator script - the Keyboard pane of System Preferences no longer contains a checkbox that allows default usage of F1, F2, etc Keys - so default selecting the first checkbox wouldn't do the trick. In fact, it should have checked Adjust keyboard brightness in low light but for whatever reason this doesn't happen.

In the end - I found this to be a solution that better suited my needs: https://www.imore.com/how-make-function-keys-default-touch-bar-display

As its application specific and not system wide - which is super ideal IMO.

Here's a fix:

tell application "System Preferences"
reveal anchor "keyboardTab" of pane "com.apple.preference.keyboard"
end tell

tell application "System Events" to tell process "System Preferences"
repeat until exists tab group 1 of window 1
end repeat
click checkbox 1 of tab group 1 of window 1
end tell

quit application "System Preferences"

Also make sure to give fn-toggle accessibility access

master updated to work with Ventura