Keyboard Shortcuts

Hello all, this is my first time here and thanks for any advice.

I have written some workflow scripts with Automator and they keyboard shortcuts all work except when I start or restart the machine. Then I must drop the services menu down and hover over the scripts with the mouse. I can then close the menu without executing the scripts and the keystrokes will then execute the script. Below is the code which hides/unhides all desktop icons but leaves any mounted disk icons visable.

on run
set spacechar to ASCII character 32
do shell script “ls -Ol ~/Desktop/” – Read chflags in ls
if result contains “staff” & spacechar & spacechar & “hidden” then
do shell script “chflags nohidden ~/Desktop/"
else
do shell script "chflags hidden ~/Desktop/

end if
end run

I have some screenshots but cannot find where to upload them.

Model: iMac (27-inch, Mid 2011)
Browser: Safari 601.2.7
Operating System: Mac OS X (10.10)

Hey There,

This kind of nonsense is unfortunately all too common with Apple.

If you want reliability and flexibility I suggest you buy a copy of FastScripts ($9.95 U.S.) or Keyboard Maestro ($36.00 U.S).

KM is by far the more versatile utility, but FS is no slouch (especially for the money). I’ve been using both since 2003.

Barring that you’ll have to put up with system flakiness “ unfortunately.


Best Regards,
Chris


MacBookPro6,1 · 2.66 GHz Intel Core i7 · 8GB RAM · OSX 10.11.1

Thanks for responding, so is the problem with Automator or with the code and if I paste this code into FastScripts and use that workflow will it be reliable in the services menu?

Model: iMac (27-inch, Mid 2011)
Browser: Safari 601.2.7
Operating System: Mac OS X (10.10)

Hey Joel,

Please only quote a relevant bit of someone else’s post that informs your own text. (Their full post is already on the forum for all to see.)

The problem is Apple’s poor support for keyboard shortcuts “ from their own software no less.

You don’t paste code into FastScripts “ FastScripts is an AppleScript/Shell-Script menu on steroids that supports app-specific and global keyboard shortcuts.

You create an AppleScript or shell script, put it in an app-specific or global folder, give it a keyboard shortcut in FastScripts’ preferences, and go-to-town.

Yes ” it works reliably.

No ” it does not alter the Services menu.

This is what it looks like:

http://www.macupdate.com/app/mac/11432/fastscripts

-Chris