Last active
May 11, 2026 08:16
-
-
Save mu-hun/f72ca7757beed4c0a748e3e4d4a4b685 to your computer and use it in GitHub Desktop.
Convert Screenshot to WebP via Folder Action (MacOS Automator)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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