Skip to content

Instantly share code, notes, and snippets.

@mu-hun
Last active May 11, 2026 08:16
Show Gist options
  • Select an option

  • Save mu-hun/f72ca7757beed4c0a748e3e4d4a4b685 to your computer and use it in GitHub Desktop.

Select an option

Save mu-hun/f72ca7757beed4c0a748e3e4d4a4b685 to your computer and use it in GitHub Desktop.
Convert Screenshot to WebP via Folder Action (MacOS Automator)
export PATH="/opt/homebrew/bin:$PATH"
FILES=("$@")
COUNT=${#FILES[@]}
for INPUT in "${FILES[@]}"; do
[[ "$INPUT" = *.webp ]] && continue
BASENAME="${INPUT%.*}"
OUTPUT="${BASENAME}.webp"
ffmpeg -i "$INPUT" -c:v libwebp -quality 90 "$OUTPUT" 2>/dev/null
trash "$INPUT"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment