Here is my code:
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory
Gui, Add, Tab2, x0 y0 w200 h20, Songlist||Cycle|How to use
Gui, Show, w200 h225, Playlist
Gui +AlwaysOnTop
Gui, Tab, 1
Gui, Add, Picture, x0 y20 w200 h230, %A_ScriptDir%/Resources/Image1.png
Gui, Add, Button, x5 y20 w190 h20 gSongOne, Song 1
Gui, Add, Button, x5 y40 w190 h20 gSongTwo, Song 2
Gui, Add, Button, x5 y60 w190 h20 gSongThree, Song 3
Gui, Add, Button, x5 y80 w190 h20 gSongFour, Song 4
Gui, Add, Button, x5 y100 w190 h20 gSongFive, Song 5
Gui, Add, Button, x5 y120 w190 h20 gSongSix, Song 6
Gui, Add, Button, x5 y140 w190 h20 gSongSeven, Song 7
Gui, Add, Button, x5 y160 w190 h20 gSongEight, Song 8
Gui, Add, Button, x5 y180 w190 h20 gSongNine, Song 9
Gui, Add, Button, x5 y200 w190 h20 gStopSong, Stop
Gui, Tab, 2
Gui, Add, Picture, x0 y20 w200 h230, %A_ScriptDir%/Resources/Image1.png
Gui, Add, Button, x5 y20 w190 h20 gCycle, Cycle through all
Gui, Tab, 3
Gui, Add, Picture, x0 y20 w200 h230, %A_ScriptDir%/Resources/Image1.png
^0::
SoundPlay, %A_ScriptDir%/Music/nonexistent.mp3
return
SongOne:
SoundPlay, %A_ScriptDir%/Music/Song1.mp3
return
SongTwo:
SoundPlay, %A_ScriptDir%/Music/Song2.mp3
return
SongThree:
SoundPlay, %A_ScriptDir%/Music/Song3.mp3
return
SongFour:
SoundPlay, %A_ScriptDir%/Music/Song4.mp3
return
SongFive:
SoundPlay, %A_ScriptDir%/Music/Song5.mp3
return
SongSix:
SoundPlay, %A_ScriptDir%/Music/Song6.mp3
return
SongSeven:
SoundPlay, %A_ScriptDir%/Music/Song7.mp3
return
SongEight:
SoundPlay, %A_ScriptDir%/Music/Song8.mp3
return
SongNine:
SoundPlay, %A_ScriptDir%/Music/Song9.mp3
return
StopSong:
SoundPlay, %A_ScriptDir%/Music/nonexistent.mp3
return
^1::
SoundPlay, %A_ScriptDir%/Music/Song1.mp3
return
^2::
SoundPlay, %A_ScriptDir%/Music/Song2.mp3
return
^3::
SoundPlay, %A_ScriptDir%/Music/Song3.mp3
return
^4::
SoundPlay, %A_ScriptDir%/Music/Song4.mp3
return
^5::
SoundPlay, %A_ScriptDir%/Music/Song5.mp3
return
^6::
SoundPlay, %A_ScriptDir%/Music/Song6.mp3
return
^7::
SoundPlay, %A_ScriptDir%/Music/Song7.mp3
return
^8::
SoundPlay, %A_ScriptDir%/Music/Song8.mp3
return
^9::
SoundPlay, %A_ScriptDir%/Music/Song9.mp3
return
Cycle:
Loop
{
SoundPlay, %A_ScriptDir%/Music/Song1.mp3, 1
SoundPlay, %A_ScriptDir%/Music/Song2.mp3, 1
SoundPlay, %A_ScriptDir%/Music/Song3.mp3, 1
SoundPlay, %A_ScriptDir%/Music/Song4.mp3, 1
SoundPlay, %A_ScriptDir%/Music/Song5.mp3, 1
SoundPlay, %A_ScriptDir%/Music/Song6.mp3, 1
SoundPlay, %A_ScriptDir%/Music/Song7.mp3, 1
SoundPlay, %A_ScriptDir%/Music/Song8.mp3, 1
SoundPlay, %A_ScriptDir%/Music/Song9.mp3, 1
}
return
Delete::ExitApp