QUOTE(300thecat @ Sep 12 2014, 12:36 PM)
Heh, you're right
This command doesn't work when I run WMP. But when I do start playing a track, it works as a next button.
Ahhh...not what I expected, but does the job well enough. My playlist file is in the My Music folder though.
Btw, important question.
Where did you learn all of these things? I also wanna learn how to learn...
Got 2 approaches actually:new and primitive
The solution as below.
From your original code, even you run the wmp and play and next song.
Everytime you press #F5, will re-run the wmp, so I try to avoid that.
You sendiri see, got comments in line of "; ".
I actually no use autohotkey, so, yesterday read some basics commands from autohotkey.com and written it.
New Method
» Click to show Spoiler - click again to hide... «
CODE
;written by quovadis123
;win + F5 to trigger next track of playlist
#F5::
;check whether wmp is running
Process, Exist, wmplayer.exe
{
;if WMP not running
If ! errorLevel {
;open playlist "wonderful"
Run, "C:\Program Files (x86)\Windows Media Player\wonderful.wpl"
;minimize WMP's window
WinMinimize, A
;play next song
Send {Media_Next}
;delay 0.1sec
Sleep, 100
}
;if WMP is running
else {
;play next song
Send {Media_Next}
;delay 0.1sec
Sleep, 100
}
}
return
Primitive Method
» Click to show Spoiler - click again to hide... «
CODE
;written by quovadis123
;win + F5 to trigger next track of playlist
#F5::
;check whether wmp is running
Process, Exist, wmplayer.exe
{
;if WMP not running
If ! errorLevel {
;open playlist "wonderful"
Run, "C:\Program Files (x86)\Windows Media Player\wonderful.wpl"
;send command next track(song), tldr ^f
SendMessage 0x111,18811,0,,Windows Media Player
;minimize WMP's window
WinMinimize, A
;delay 0.1sec
Sleep, 100
}
;if WMP is running
else {
;wait until WMP exists
WinWait, Windows Media Player,
;in case WMP window not active, activate WMP
IfWinNotActive, Windows Media Player, , WinActivate, Windows Media Player,
;wait until WMP window actived
WinWaitActive, Windows Media Player,
;send command next track(song), tldr ^f
SendMessage 0x111,18811,0,,Windows Media Player
;minimize WMP's window
WinMinimize, A
;delay 0.1sec
Sleep, 100
}
}
return
This post has been edited by quovadis123: Sep 12 2014, 12:53 PM