Jump to content

Recommended Posts

Posted

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

Posted (edited)

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...