A script that random play video. To put in vlc folder.
You NEED to add the option ----one-instance in the command line or you will have a new window for next video
This script work for all file, so avoid to have a *.txt in the folder
You need to change the sleep values according to your temporisation.
#include <Array.au3>
#include<file.au3>
;Parsing
Local $count = StringInStr($CmdLineRaw, ".exe", 0 , 1, 1)
local $app = StringLeft ( $CmdLineRaw, $count + 4 )
local $command = StringTrimLeft( $CmdLineRaw, $count + 4 )
if not $command then exit 0
;Special parsing
$count = StringInStr($command, '"', 0 , -2)
local $folder = StringTrimLeft( $command, $count )
$command = StringLeft( $command, $count - 2)
$count = StringInStr($folder, '\', 0 , -1)
$folder = StringTrimright( $folder, $count )
HotKeySet("{ESC}", "Terminate")
Local $avi_folder = _FileListToArray($folder, "*.*", 1)
If IsArray($avi_folder) Then
;_ArrayDisplay($avi_folder) ; View contents of $avi_folder
Else
MsgBox(0, "Error", "Files not found in directory")
EndIf
local $avinumber = UBound($avi_folder) - 1
local $Randomfile =''
local $PID
$Randomfile = $avi_folder[Random(1, $avinumber )]
$PID = Run ('"' & $app & '" ' & $command & ' "' & $folder & $Randomfile & '"')
While 1
sleep(10000)
$Randomfile = $avi_folder[Random(1, $avinumber )]
Run ('"' & $app & '" ' & $command & ' "' & $folder & $Randomfile & '"')
WEnd
exit 0
;****************************************************
;Functions
Func Terminate()
While ProcessExists ( $PID )
ProcessClose ( $PID )
WEnd
Exit 0
EndFunc
This script isn't finished and I will don't finish it, but it's a good base to start your own script.