on open of theFiles set desktopPath to POSIX path of (path to desktop)
repeat with aFile in theFiles set filePath to POSIX path of aFile set fileName to do shell script "basename " & quoted form of filePath set destPath to desktopPath & text 1 thru -5 of fileName & ".gif"
set shellCommand to "/opt/homebrew/bin/ffmpeg -i " & quoted form of filePath & " -vf \"fps=10,scale=-1:-1:flags=lanczos\" -c:v gif -f gif " & quoted form of destPath
do shell script shellCommand end repeat end open
Video抽取音频
on open of theFiles set desktopPath to POSIX path of (path to desktop)
repeat with aFile in theFiles set filePath to POSIX path of aFile set fileName to do shell script "basename " & quoted form of filePath set destPath to desktopPath & text 1 thru -5 of fileName & ".gif"
set shellCommand to "/opt/homebrew/bin/ffmpeg -i " & quoted form of filePath & " -vf \"fps=10,scale=-1:-1:flags=lanczos\" -c:v gif -f gif " & quoted form of destPath
do shell script shellCommand end repeat end open
webp转PNG
on open of theFiles repeat with aFile in theFiles set filePath to POSIX path of aFile if filePath ends with "-webp"then set outputPath to POSIX path of (path to desktop folder) & (do shell scri do shell script "sips-s format png " & quoted form of filePath & " --out end if end repeat end open