'===============================================================================
' Добавление сверху содержимого AVS-скрипта команды фильтра с путём к видеофайлу
' Параметры: "<путь к avs>" "<путь к видео>" <команда фильтра>
' Пример: %V %T%M AviSource
'===============================================================================
With WSH.Arguments
If .Count <> 3 Then MsgBox "Укажите 3 параметра!",_
4144, " Правка (создание) AVS" : WSH.Quit
AVS = .Item(0) : VFile = .Item(1) : Pref = .Item(2)
End With : Str = Pref & "(""" & VFile & """)"
Exs = " asf avi divx flv mkv mov mp4 mpg ts "
With CreateObject("Scripting.FileSystemObject")
If .FileExists(VFile) And InStr(Exs, " " & LCase(.GetExtensionName(VFile) & " ")) Then
If .FileExists(AVS) And LCase(.GetExtensionName(AVS)) = "avs" Then
All = "" : If .GetFile(AVS).Size <> 0 Then All = .OpenTextFile(AVS).ReadAll
If InStr(All, Str) <> 1 Then .OpenTextFile(AVS, 2).Write Str & vbNewLine & All
Else nAVS = .GetParentFolderName(AVS) & "\" & .GetBaseName(VFile) & ".avs"
If Not .FileExists(nAVS) Then .CreateTextFile(nAVS).WriteLine Str
End If
End If
End With |