This is so bizarre. I'm trying to toggle the "Show Desktop" feature of Mission Control.
The Keyboard Shortcut for that setting is set to F11. However, I want to use an icon in the dock, so it's easier to toggle when I'm controlling it from my iPad/iPhone.
I have a KM Macro where all it does is simulate F11. I save it as a trigger file to my desktop.
If I launch the trigger file from the desktop, it works fine. Running it either shows the desktop (hides apps) or restores/shows the hidden apps).
However, I dragged the trigger file to my Dock, and if all my windows are showing, and I click on the Dock, everything hides (i.e. Show Desktop "on"). So far so good.
But if I click on the Dock icon again, it restores all hidden apps, but then hides them again (almost as if it hit F11 twice).
I've even deleted the macro and re-created it and the trigger file from scratch and I get the same results.
I've even tried using an Applescript instead of KM's native "type a keystroke" but I get the same results:
tell application "System Events"
key code 103 -- This simulates F11, the default "Show Desktop" shortcut
end tell
Any ideas on what the heck is going on and/or if there's a workaround for this odd behavior?