Jump to content

Media Player Control


Drought
 Share

Recommended Posts

i want to write a script to switch tracks in my media player.

i wrote a script but theres a problem if i want to start: it opens then itcloses after 3 secs...

the script is :

HotKeySet("^{HOME}", "TogglePause")
HotKeySet("^{END}", "ToggleStop")
HotKeySet("^{PGDN}", "ToggleNext")
HotKeySet("^{PGUP}", "TogglePrev")


Func TogglePause
    Send ( "{MEDIA_PLAY_PAUSE}" )
EndFunc

Func ToggleStop
    Send ( "{MEDIA_STOP}" )
EndFunc

Func ToggleNext
    Send ( "{MEDIA_NEXT}" )
EndFunc

Func TogglePrev
    Send ( "{MEDIA_PREV}" )
EndFunc

maybe all is wrong...im a noob^^

Link to comment
Share on other sites

while 1
HotKeySet("^{HOME}", "TogglePause")
HotKeySet("^{END}", "ToggleStop")
HotKeySet("^{PGDN}", "ToggleNext")
HotKeySet("^{PGUP}", "TogglePrev")
WEnd


Func TogglePause()
    Send ( "{MEDIA_PLAY_PAUSE}" )
EndFunc

Func ToggleStop()
    Send ( "{MEDIA_STOP}" )
EndFunc

Func ToggleNext()
    Send ( "{MEDIA_NEXT}" )
EndFunc

Func TogglePrev()
    Send ( "{MEDIA_PREV}" )
EndFunc

now it should work

Edited by jaenster

-jaenster

Link to comment
Share on other sites

and or im not sure if thatll cause a recursion limit

HotKeySet("^{HOME}", "TogglePause")
HotKeySet("^{END}", "ToggleStop")
HotKeySet("^{PGDN}", "ToggleNext")
HotKeySet("^{PGUP}", "TogglePrev")
While 1
sleep(100)
Wend



Func TogglePause()
    Send ( "{MEDIA_PLAY_PAUSE}" )
EndFunc

Func ToggleStop()
    Send ( "{MEDIA_STOP}" )
EndFunc

Func ToggleNext()
    Send ( "{MEDIA_NEXT}" )
EndFunc

Func TogglePrev()
    Send ( "{MEDIA_PREV}" )
EndFunc
Link to comment
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
 Share

  • Recently Browsing   0 members

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