Sign in to follow this  
Followers 0
Drought

Media Player Control

4 posts in this topic

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^^

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Thanks it works now :)

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  
Followers 0