;----------------------------------------------- #include #include #include #include ;----------------------------------------------- Local $hGUI = GUICreate("Session List Producer", 940, 255) GUISetFont(12, 800, 0, "Calibri") ;----------------------------------------------- Local $AddToList = GUICtrlCreateButton("Add to List", 10, 10, 200, 25) Local $ListView = GUICtrlCreateListView("Current Session Files Listing", 220, 10, 500, 235, 0x0008, 0x00000020) _GUICtrlListView_SetColumnWidth($ListView, 0, 500) Local $ExitMe = GUICtrlCreateButton("Exit", 10, 40, 200, 25) ;----------------------------------------------- GUISetState(@SW_SHOW, $hGUI) ;----------------------------------------------- While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $AddToList _AddToList($ListView) Case $ExitMe _ExitMe($ListView) EndSwitch WEnd ;----------------------------------------------- Func _AddToList($ListView) ; SECTION A ; 1) Ask: Is there a SHOW file? ; If NO, then go to CreateShowFile($ListView) ; If YES then continue ;----------------- Local $MyBox = MsgBox(4, "Is there a SHOW file?", "Yes or No") If $MyBox == 7 Then _CreateShowFile($ListView) ElseIf $MyBox == 6 Then EndIf ;----------------- Local $WorkingDir = 'E:\Master_Backup' Local $iItem Local $sFileSelectDialog = FileOpenDialog('Select Session Files', $WorkingDir, 'Data Files (*.edl; *.shw)', 4) If @error Then Return SetError(1, 0, Null) Local $aSplit = StringSplit($sFileSelectDialog, '|') If Not IsArray($aSplit) Then Return SetError(1, 0, Null) If $aSplit[0] = 1 Then $iItem = _GUICtrlListView_FindText($ListView, $aSplit[1], -1, False) If $iItem = -1 Then GUICtrlCreateListViewItem($aSplit[1], $ListView) Else MsgBox(0x40, 'Info!!', $aSplit[1] & ' is already in the Session Listing.') EndIf Else _GUICtrlListView_BeginUpdate($ListView) For $Index = 2 To $aSplit[0] $iItem = _GUICtrlListView_FindText($ListView, $aSplit[1] & '\' & $aSplit[$Index], -1, False) If $iItem = -1 Then GUICtrlCreateListViewItem($aSplit[1] & '\' & $aSplit[$Index], $ListView) Else MsgBox(0x40, 'Info!', $aSplit[1] & '\' & $aSplit[$Index] & ' is already in the Session Listing.') EndIf Next _GUICtrlListView_EndUpdate($ListView) EndIf EndFunc ;==>_AddToList ; ----------------- Func _CreateShowFile($ListView) Local $SrcFilename = "E:\Master_Backup\Shows\Master_Show.shw" Local $DstFilePath = "E:\Master_Backup\Shows" ; SECTION B ; If SET, then enter SET name GLobal $SetName = InputBox("Notice!", "Please enter the SET name...") ; Add SET name to $DstFilePath Local $UpdatedPath = $DstFilePath & "\" & $SetName & ".shw" FileCopy($SrcFilename, $UpdatedPath, $FC_OVERWRITE) EndFunc ;==>_CreateShowFile ; ----------------- Func _ExitMe($ListView) Exit EndFunc ;==>_ExitMe ;-----------------------------------------------