Code: Select all
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
;;;;;;;;start code;;;;;;;;;
#persistent
#singleinstance
#NoTrayIcon
Gui, Margin, 10, 10
Gui, add, text , xm ym w30 h20 Right 0x200 , Artist:
Gui, add, edit , xm+35 ym w100 h20 vArtist ,
Gui, add, text , xm+140 ym w30 h20 Right 0x200 , Song:
Gui, add, edit , xm+175 ym w100 h20 vSong ,
Gui, add, button, xm+280 ym w50 h20 Default , Search
Gui, Add, Edit , xm ym+30 w330 h400 ReadOnly vLyrics_edt,
Gui, Add, Statusbar
SB_SetText( "Ready." )
; Gui, add, button, x90 y98, Cancel
Menu, FileMenu, Add, About, AboutFun
Menu, FileMenu, Add, Help, HelpFun
Menu, MenuBar, Add, Menu, :FileMenu
Menu, transmenu, Add, Low, Low
Menu, transmenu, Add, Medium, Medium
Menu, transmenu, Add, Full, Full
Menu, OptionsMenu, Add, Transparency, :transmenu
Menu, OptionsMenu, Add, Keep On Top, kot
Menu, MenuBar, Add, Options, :OptionsMenu
Gui, Menu, MenuBar
Gui, show, AutoSize Center, Lyric Grabber
Return
;;;;;;;;;;;;;;;;Button Actions;;;;;;;;;;;;;
AboutFun:
Msgbox, Made using AutoHotKey script
Return
HelpFun:
Msgbox, Song and artist titles MUST be capitilized and spelled properly or you will not achieve proper results. Otherwise, the problem is most likely because Lyricwiki.org does not have the song in archive.
Return
Low:
WinSet, Transparent, 100, Lyric Grabber
Menu, transmenu, check, Low
Menu, transmenu, Uncheck, Medium
Menu, transmenu, Uncheck, Full
Return
Medium:
Winset, Transparent, 200, Lyric Grabber
Menu, transmenu, check, Medium
Menu, transmenu, Uncheck, Low
Menu, transmenu, Uncheck, Full
Return
Full:
Winset, Transparent, Off, Lyric Grabber
Menu, transmenu, check, Full
Menu, transmenu, Uncheck, Medium
Menu, transmenu, Uncheck, Low
Return
kot:
Winset, AlwaysOnTop, Toggle
Menu, OptionsMenu, togglecheck, Keep On Top
Return
ButtonCancel:
exitapp
Return
GuiEscape:
GuiClose:
{
ExitApp
}
Return
ButtonSearch:
Gui, submit, NoHide
GuiControl, Text, Lyrics_edt
SB_SetText( "Procurando..." )
Sleep, 50
url= https://www.letras.mus.br/%Artist%/%Song%
wb := ComObjCreate("InternetExplorer.Application")
wb.Navigate(url)
wb.Visible := false
while wb.readyState!=4 || wb.document.readyState != "complete" || wb.busy
sleep 10
try
{
Lyrics3:= wb.document.getElementsbyClassName("cnt-letra p402_premium")[0].innerText
}
catch e ; Handles the first error/exception raised by the block above.
{
MsgBox, An exception was thrown! check artist and song name
return
}
SB_SetText( "Done." )
GuiControl,, Lyrics_edt, %Lyrics3%
wb.quit
return