Skip to content

Instantly share code, notes, and snippets.

@ravikumarjain
Created August 21, 2018 08:14
Show Gist options
  • Save ravikumarjain/703eca1998ec8f34067ae997732c4fcd to your computer and use it in GitHub Desktop.
Save ravikumarjain/703eca1998ec8f34067ae997732c4fcd to your computer and use it in GitHub Desktop.
This autohotkey script opens randomly any file from a folder.
;This is not my original script. I took from sevral places (please see links below) and combined it in one script.
;https://autohotkey.com/board/topic/10394-run-some-random-file-jpg-present-in-a-list/
Loop, D:*.pptx
{
Filenames .= A_LoopFileFullPath . "`n"
}
FileAppend, %Filenames% , D:\ravi1.txt
Loop, Read, D:\ravi1.txt
LineCnt++
Random, LineNum, 1, %LineCnt%
FileReadLine, RandomFileToOpen, D:\ravi1.txt, %LineNum%
Run, %RandomFileToOpen%
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment