I would like to do this: When the application VLC is open and I press the space bar, it pauses the video and an itunes starts to play. Then spacebar again would resume the workout video and pause my song.

Is there a way to do this on mac? Maybe using an actionscript or else?


IF (VLC open and spacebar pressed) { play this song on itunes} else { pause the song }


This is possible since you can use macruby's bridge support to control itunes and VLC's interfaces over TCP. You can find the required material from these links



Don't expect the answer to be as short as you believed. You will have to do the coding yourself as I don't have time enough to make the code and to post it.


Here's a quick solution in Applescript that could be triggered by a simple shortcut:

tell application "iTunes"
    if player state is stopped then
        tell application "VLC" to activate
        tell application "System Events" to keystroke space
    end if
end tell

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.