Can't assign shortcuts with F keys.
  • I can't assign shortcuts with F keys unless I enter fn and the F key, but then fn is not part of the shortcut. Can shortcuts be assign without typing in the shortcut field?
  • Hi - the "fn" is never part of a shortcut per. It's a higher level thing that Apple uses to facilitate using some of the Function keys for two purposes. For those keys with special purposes you literally have to press e.g. fn-F4 to "mean" F4.

    Is your end goal to have it so that pressing e.g. fn-F4 runs a script? If so then you should literally type that while editing the shortcut. Then it will run the script whenever you press fn-F4. If your end goal is to have just F4 run the script, you'll have to invert the default behavior for Function Keys in System Preferences, Keyboard preferences. The checkbox "Use all F1, F2, etc. keys as standard function keys."
  • Hi Daniel,

    I was trying to literally type “fn-F7” as you wrote but no way. As soon as I type the « f » (as first character for “fn…”) FastScripts exits from the Shortcut field and it takes only “f” :-(
    No way even with paste the whole “fn-F7” string [it takes ⌘-V ] and no way using the contextual menu in the Shortcut field and its Paste command [ I can see fn-F7 in the field at last, but as soon as I click elsewhere, the Shortcut returns (none) …]
    Am I missing anything?
  • Hi dedalus - what I mean when I say "literally" press fn-F4 is on keyboard where this is required (maybe all of them, by now?) you have to press a key on your keyboard labeled "fn" to let a Function key be processed by the system as a Function key, instead of as e.g. a brightness, spotlight, play, pause, etc. key.

    If your F1 key for example has a little sun icon on it to make the brightness dimmer, then pressing it doesn't cause an F1 key to be sent by default. You have to press fn-F1 to get an F1 key to be sent.

    And as I said above this is a preference option which you can toggle in System Preferences under Keyboard Preferences.
  • Hi Daniel,
    :#) … I already knew about preference option in Sys Pref, any way you are right. And actually now it works. But I had written my post because when I had typed ("literally" as your suggestion [fn] key) & [F7] key the first times, my script didn't run with [fn][F7] keys. And I really don't know why now it works and not before.

    I have another little question please. If I assign to a script "foo" a shortcut (say, "⌘H") does FastScripts also recognize other modifier keys using that shortcut "⌘H"? I mean if I type "⌘ Shift H" FastScripts could run that script "foo"? I ask because I tried but seems to not work. And it may seem a rather strange question, but I have a way to change the script behavior starting the script with a "modifier keys" or another. If you get this page you'll understand better the point https://bitbucket.org/anddam/checkmodifierkeys/

    And so running "foo" (+ modifiers) from FastScript's menu everything works, not so using shortcut. I fear to imagine this is not possible at all. Isn't it? Thanks a lot in advance.
  • The keyboard shortcuts in FastScripts are very precise, so no, Cmd-Shift-H for example would never invoke a script that was configured only for Cmd-H. Also, you can't assign more than one keyboard shortcut to a single script.

    However, a workaround that you might be interested in would be to make a hard link to the script from the terminal. This would cause FastScripts to recognize the single file as being two different files. So for example if the script you want to do this with is called "MyScript.scpt", try from the Terminal in the script folder where it resides:

    ln MyScript.scpt MyScript2.scpt

    Now you should be able to assign a keyboard shortcut separately to MyScript2.scpt, and the content of the same script should be run in either case.
  • Hmmm … this sounds rather interesting, thanks.
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!