; 2005/10/27 dokas_mg (update 2007/08/25) ; 必要なソフト Carmine CraftDrop #NoEnv #SingleInstance ignore If 0 != 1 { MsgBox, 48, , ディレクトリ、またはファイルを`n1つ渡してください Return } ; (環境依存) carmine.exe のパス pathCarmine = C:\Carmine\carmine.exe ; (環境依存) cdrop.exe のパス pathCDrop = C:\CDrop\cdrop.exe szMax = 0 Start: Process, Exist, carmine.exe If ErrorLevel <> 0 { MsgBox, 48, , 多重起動はできません Return } Run, "%pathCarmine%", , , p wMain = ahk_pid %p% ahk_class TFm_Main wError = エラー ahk_pid %p% ahk_class TMessageForm wNoFile = ファイルがありません ahk_pid %p% ahk_class #32770 WinWait, %wMain% Process, Priority, %p%, BelowNormal Run, "%pathCDrop%" /tJPEG /cTFm_Main "%1%" Loop { IfWinExist, %wError% { WinWaitClose, %wError% closeCarmine(p) Break } IfWinExist, %wNoFile% { WinWaitClose, %wNoFile% closeCarmine(p) Break } WinGetText, text, %wMain% IfInString, text, 処理の対象, Break Sleep, 250 } IfWinNotExist, %wMain% Return WinMenuSelectItem, %wMain%, , 2&, 1& Loop { WinGetText, text, %wMain% If ErrorLevel = 1 Break IfInString, text, 処理時間, Break Sleep, 250 } IfWinNotExist, %wMain% Return StringGetPos, p1, text, 合計, L1 StringGetPos, p2, text, byte, R1 If ((p1 = -1) || (p2 = -1)) { ; ファイル数 1 の場合 MsgBox, 36, , 処理完了`n`n1ファイルの場合、`n自動繰り返し処理はできません`n`nもう一度処理しますか? closeCarmine(p) IfMsgBox, Yes Goto, Start } Else { p1 := p1 + 5 p2 := p2 - p1 + 1 StringMid, text, text, %p1%, %p2% StringReplace, text, text, yte→ StringSplit, sz, text, b If szMax = 0 szMax := sz1 sz := sz1 - sz2 If sz = 0 { sz := szMax - sz2 MsgBox, 64, , 処理完了`n`n%szMax%byte -> %sz2%byte (%sz%byte削減) closeCarmine(p) } Else { closeCarmine(p) Goto, Start } } Return closeCarmine(pID) { WinMenuSelectItem, ahk_pid %pID% ahk_class TFm_Main, , 1&, 4& WinWaitClose, ahk_pid %pID% ahk_class TFm_Main Return }