14

By "global" I mean that kind of shortcuts that I am using in Windows and that are set within and for an application but that can be used when that application is hidden or minimized (not on top). (e.g. the ones discussed here.)

I see that in this article here on "OS X Mavericks: Use global keyboard shortcuts" that shortcuts are called "global" but in a different sense - it seems to me - because they are only available if the given application is already active (focused upon, on top, like for example a text editor in which I can write) but not if it is not in this position (for example: if the text editor is open and ready for writing, then, the shortcuts available for an audio player will not be accessible).

So, I am not referring to the media keys on the keyboard, but to ones that I can set in an application and then can use when other application is active and actively used.

When adding some shortcuts for vlc under Keyboard settings, they are not global in this sense.

enter image description here

2
  • Are solutions with 3rd-party software ok?
    – grg
    Mar 19, 2014 at 12:55
  • @grgarside - as i imagine that natively there is no solution, yes!
    – user61618
    Mar 19, 2014 at 13:01

2 Answers 2

11

You can assign a shortcut to a script like this:

tell application "System Events" to tell process "VLC"
    click menu item "Step Forward" of menu 1 of menu bar item "Playback" of menu bar 1
end tell

For example save the script in ~/Library/Scripts/ in AppleScript Editor and then use FastScripts to give it a shortcut. Or if you have bought the Powerpack for Alfred, you can create a workflow with a Hotkey trigger connected to a Run Script action.

0

In addition to the answer by @Lri which probably works fine, but without installing any 3rd-party software, you can also save your script to ~/Library/Services and it should be accessible from the Keyboard Shortcuts screen under "Services > General", similar to what you tried to do originally except do not look under "App Shortcuts" because, as you say, these only work if the app is running. If you get your script listed under "Services > General", and assign the hotkey there, it should be accessible globally.

more detailed information here: https://scriptingosx.com/2019/05/open-apps-with-custom-shortcut-in-macos/

You must log in to answer this question.