Tosyk
Новичок
- Сообщения
- 206
- Репутация
- 0
Подскажите почему скрипт не конвертирует файл, который я кидаю на скомпилированный из этого скрипта EXE:
Код:
#Include <File.au3>
AutoItSetOption("MustDeclareVars", 1)
Local $i
Local $sSourceFile, $sDestFile
Local $sDrive, $sFolder, $sFileName, $sExt
Local $sPattern = "\.(?i:tga|jpg|bmp|dds|png|tif|jpeg)"
If $CmdLine[0] <> 0 Then
If FileExists("C:\Program Files\ImageMagick\convert.exe") Then
ProgressOn("Converting", "", "0%")
For $i = 1 To $CmdLine[0]
$sSourceFile = $CmdLine[$i]
ProgressSet(($i / $CmdLine[0]) * 100, $sFileName & $sExt, String(Round($i / $CmdLine[0] * 100, 1)) & "%")
If FileExists($sSourceFile) Then
_PathSplit($sSourceFile, $sDrive, $sFolder, $sFileName, $sExt)
If StringRegExp($sExt, "\A" & $sPattern & "\z", 0) = 1 Then
$sDestFile = _PathMake($sDrive, $sFolder, $sFileName, ".png")
;~ RunWait('""C:\Program Files\ImageMagick\convert.exe"" & $sSourceFile & "" -alpha on "" & $sDestFile &',@SW_HIDE)
;~ RunWait('"C:\Program Files\ImageMagick\" & "convert.exe" & $sSourceFile & -someParam', "","")
RunWait('"' & 'C:\Program Files\ImageMagick\convert.exe' & $sSourceFile & '" -alpha on "' & $sDestFile & '"', '', @SW_HIDE)
Else
ConsoleWriteError("Extension of file [" & $sSourceFile & "] is [" & $sExt & "] and not in [" & $sPattern & "]" & @CRLF)
EndIf
Else
ConsoleWriteError("File [" & $sSourceFile & "] not found" & @CRLF)
EndIf
Next
ProgressSet(100 , "Converting complete", "100%")
Sleep(1000)
ProgressOff()
EndIf
Else
MsgBox(0, "Usage", @ScriptName & " <file>")
ConsoleWrite("Usage: " & @ScriptName & " <file>" & @CRLF)
EndIf
Exit(0)