Jump to content

Recommended Posts

Posted (edited)

This tool will let you choose files to copy. If in The dir in which file exist with name video.avi is a file with name video.srt will copy both files to a specific location and will convert the video.srt to unicode

If you choose a file with subtitle the label colour will be blue

(This tool help me a lot because when i copy a movie to my hdd player sometimes i forget to convert the subtitles to unicode. It makes me sick so i created this tool)

(updated)

#include <GUIConstants.au3>
#include <file.au3>
#include <winapi.au3>

Opt("GUIOnEventMode", 1)

Dim $arraydat[1][5]
Global $folder, $dir, $drive, $pathexd, $filen, $fileend
$i = 75
$help = ""
$fname = "Form1"
$Form1 = GUICreate($fname, 633, 447, 193, 125)
$Button1 = GUICtrlCreateButton("Start", 512, 400, 113, 41, 0)
$Obj1 = ObjCreate("CompatUI.SelectFile.1")
$Obj1_ctrl = GUICtrlCreateObj(obj($Obj1), 56, 56, 486, 93)
GUICtrlSetState(-1, $GUI_ACCEPTFILES)
GUISetState(@SW_SHOW)
GUISetOnEvent(-3, "exitgui")
GUICtrlSetOnEvent($Button1, "Startp")
$is = -1
While 1
    $is += 1
    While 1
        $gettext = $Obj1.FileName()
        If $gettext <> $help Then
            $i += 11
            $arraydat[$is][0] = $gettext;path C:\a\a.vad
            GUICtrlCreateLabel($gettext, 56, $i)
            $Obj1.FileName = ""
            $getu = StringReplace($gettext, "avi", "srt")
            If FileExists($getu) Then
                GUICtrlSetColor(-1, 0x0000FF)
                $arraydat[$is][2] = "1";1 or n
            Else
            EndIf
            _PathSplit($gettext, $drive, $pathexd, $filen, $fileend)
            $Obj1.BrowseInitialDirectory = $drive & $pathexd
            ExitLoop
        Else
        EndIf
    WEnd
    ReDim $arraydat[$is + 2][5]
WEnd
Func exitgui()
    Exit
EndFunc  ;==>exitgui

Func Getun($str, $stop)
    Local $word = ""
    For $iasdf = 1 To StringLen($str) Step 1
        $charat = StringMid($str, $iasdf, 1)
        If $charat = $stop Then ExitLoop
        $word &= $charat
    Next
    Return $word
EndFunc  ;==>Getun
Func obj($var)
    With $var
        .BrowseTitle = "Διάλεξε αρχεία"
        .BrowseInitialDirectory = "E:\ADownloads"
        .BrowseFilter = "Allfiles (*.*)"
    EndWith
    Return $var
EndFunc  ;==>obj

Func Startp()
    $folder = FileSelectFolder("Choose folder", "")
    $rows = UBound($arraydat)
    For $sc = 0 To $rows - 2 Step 1
        _PathSplit($arraydat[$sc][0], $drive, $pathexd, $filen, $fileend)
        $arraydat[$sc][1] = $filen & $fileend;movie.avi
        $arraydat[$sc][3] = $drive & $pathexd & $filen & ".srt";path with sub
        $arraydat[$sc][4] = $filen & ".srt";sub name
    Next
    For $1i = 0 To UBound($arraydat) - 2 Step 1
        $num = $arraydat[$1i][2]
        If $num = 0 Then
            _FileCopy($arraydat[$1i][0], $folder & "\")
        Else
            _FileCreate($folder & "\" & $arraydat[$1i][4])
            $fo = FileOpen($arraydat[$1i][3], 0)
            $fr = FileRead($fo)
            $unic = DllStructGetData(_WinAPI_MultiByteToWideChar($fr), 1)
            $fw = FileOpen($folder & "\" & $arraydat[$1i][4], 2)
            FileWrite($fw, $unic)
            _FileCopy($arraydat[$1i][0], $folder & "\")
        EndIf
    Next
EndFunc  ;==>Startp

Func _FileCopy($fromFile, $tofile)
    Local $FOF_RESPOND_YES = 16
    Local $FOF_SIMPLEPROGRESS = 256
    $winShell = ObjCreate("shell.application")
    $winShell.namespace($tofile).CopyHere($fromFile, $FOF_RESPOND_YES)
EndFunc  ;==>_FileCopy

The link below are not updated

filecopy.au3

filecopy.exe

Edited by vakis

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...