Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;#warn
- #NoEnv
- #SingleInstance, Force
- Process, Priority, , A
- SendMode, Input
- SetBatchLines, -1
- ;#NoTrayIcon
- SetWorkingDir %A_ScriptDir%
- VLC = %A_programfiles%\VideoLAN\VLC\vlc.exe
- Gui, Add, Button, x10 y10 w100 h30 gBrowse, Browse
- Gui, Add, Edit, x10 y50 w900 h560 vSelectedLine, Selected Line will appear here
- Gui, Add, Edit, x10 y620 w400 h26 vSearchText, Type here to search
- Gui, Add, Button, x420 y620 w100 h30 gSearch, Search
- Gui, Add, Button, x530 y620 w100 h30 gPlay, Play
- Gui, Add, Button, x640 y620 w100 h30 gExit, Exit
- Gui, Show, w920 h660, AutoHotkey GUI
- return
- Browse:
- FileSelectFile, SelectedFile, 1, , Select a text file, Text files (*.txt)
- if (ErrorLevel)
- return
- FileRead, FileContent, %SelectedFile%
- GuiControl,, SelectedLine, %FileContent%
- return
- Search:
- GuiControlGet, searchText, , SearchText
- GuiControlGet, fileContent, , SelectedLine
- StartPosition := RegExMatch(fileContent, searchText, Position)
- if (StartPosition > 0)
- {
- SelectedText := SubStr(fileContent, StartPosition)
- GuiControl,, SelectedLine, %SelectedText%
- }
- else
- {
- MsgBox, No match found!
- }
- return
- Play:
- ControlGet, outputvar, Selected,,Edit1,
- Run, "%VLC%" --fullscreen --playlist-enqueue "%outputvar%"
- return
- Exit:
- GuiClose:
- ExitApp
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement