Sign in to follow this  
Followers 0
Drought

Media Player

5 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



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

while 1
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

#3 ·  Posted (edited)

It would be wise to add a sleep so it does not eat the entire cpu.

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

Also , please remember to post v3 questions in the v3 support forum.

Edited by SolidSnake

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites

how can I set an avatar on this message board? :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

how can I set an avatar on this message board? :)

This page:

http://www.autoitscript.com/forum/index.ph...rCP&CODE=24

Also, It is wise to start your own thread instead of hijacking somebody else's, especially when it has nothing to do with the topic at hand.

Edited by SolidSnake

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0