こんなスクリプト書いてください in ソフト板 part1
おじゃまします。【テンプレ厳守】こんなソフトウェアありますか?Part65 から引っ越してきました。
指定ディレクトリ以下のアニメーションGIFの列挙、およびMNG化を行うつもりです。
@echo off
if %1/ == / goto usage
setlocal
set PATH="D:\Program Files\ImageMagick-6.2.5-Q16";%PATH%
if %1/ == --convert-to-mng/ (
set opt_mng=1
shift
)
for /R %1 %%i in ( . ) do if exist "%%~i\*.gif" call :recursive "%%~i"
endlocal
goto :EOF
:recursive
pushd %1
identify -format "#ofScenes:%%n Scene#:%%s %%f\n" *.gif | find /v "#ofScenes:1 " | find "Scene#:1 " >.#ofScenes.txt
for /F "usebackq tokens=2*" %%j in ( .#ofScenes.txt ) do echo %~f1\%%k
if %opt_mng%/ == 1/ for /F "usebackq tokens=2*" %%j in ( .#ofScenes.txt ) do if not exist "%%~nk.mng" convert "%%k" "%%~nk.mng"
del .#ofScenes.txt
popd
goto :EOF
:usage
echo usage: %0 [--convert-to-mng] startdir
echo Search animation gif files underneath startdir
echo if --convert-to-mng specified, mng files will be created in same dir.