2

I see here that Automator can be used to create commands that then can be triggered globally.

I have no idea how to use Automator but see that it has some options for involving applications... Can a "service" be created for VLC that will then be bound to keystroke triggers?

What I want are simple commands like pause/play, back and forward that could be used with shortcuts no matter what other window application is on top.

  • Just out of interest what Mac do you have. – Ruskes Mar 19 '14 at 13:31
  • @Buscar웃 - macbook air and mavericks – user61618 Mar 19 '14 at 13:35
  • My MBA has the media keys for that function, do they not work for you? – Ruskes Mar 19 '14 at 13:39
  • @Buscar웃 - there are three on my keyboard, next, previous and play/pause. i am interested in a larger range of shortcuts that would work in the same way, especially in back/forward (within the same file). vlc has three levels of jump back-forward, iTunes only one. I use this for transcription so it is a big difference to me – user61618 Mar 19 '14 at 13:41
  • If you press the back-forward keys, it's go back/forward in the same file... – Thomas Ayoub Mar 19 '14 at 16:20
2

You can create services like this:

Then give the services shortcuts from System Preferences > Keyboard > Shortcuts > Services.

I prefer using third party applications instead of services to assign shortcuts to scripts though. There has been a bug since 10.7 where the shortcuts for services don't always work until you hover over the services menu from the menu bar (or for example run a service once from the menu bar). There is also a noticeable delay before services are run, and the shortcuts for services don't work when an application that doesn't have a services menu (like Tower) is frontmost.

More examples:

tell application "VLC"
    if playing then
        tell application "System Events" to tell process "VLC"
            click menu item "Pause" of menu 1 of menu bar item "Playback" of menu bar 1
        end tell
    else
        play
    end if
end tell
tell application "VLC"
    set n to 60
    if duration of current item - current time > n then
        set current time to current time + n
    else
        next
    end if
end tell
tell application "VLC"
    set fullscreen mode to not fullscreen mode
end tell
tell application "VLC"
    volumeUp
end tell

Open VLC's dictionary in AppleScript Editor to see all supported terminology.

You must log in to answer this question.