Jump to content

Recommended Posts

Posted

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

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

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