Drought Posted September 16, 2006 Share Posted September 16, 2006 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 More sharing options...
jaenster Posted September 16, 2006 Share Posted September 16, 2006 (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 September 16, 2006 by jaenster -jaenster Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted September 17, 2006 Share Posted September 17, 2006 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 More sharing options...
Drought Posted September 17, 2006 Author Share Posted September 17, 2006 Thanks it works now Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now