Jump to content
Sign in to follow this  
stencil98

Play/pause VLC

Recommended Posts

stencil98

Hey all,

I want to make a script that sends a <space> to the VLC media player to play or pause the current song. What am I doing wrong on this script?

WinActivate("VLC")
Send("{SPACE}")

It seemed so simple...

 

Thanks in advance,

Sten

Share this post


Link to post
Share on other sites
Palestinian

Hello stencil, to start with, you are giving it the wrong title (unless your VLC player is different than the one I got), if you don't give it the correct title it won't activate VLC window.

Here is a working example (for my VLC at least):

HotKeySet("{PAUSE}", "TogglePause")


TogglePause()

Func TogglePause()
    $VLC = WinGetHandle("[CLASS:QWidget]","VLC (Direct3D output)")
    ControlSend("","",$VLC,"{SPACE}")
    While 1
        Sleep(100)
    WEnd
EndFunc   ;==>TogglePause

Use "Pause" button to Pause/Resume songs.

Edited by Palestinian

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×