Created
October 23, 2020 12:44
-
-
Save zealot128/744703de7e43c271012714f50f3a16eb to your computer and use it in GitHub Desktop.
MacOS Automator: Convert file with Handbrake CLI Quick Action
This file contains 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
# I use this script to quickly convert Screencasts with HandbrakeCLI to Gmail Large 3 minutes, | |
# which has an OK quality for a screencast but is very small - | |
# Perfect for quickly showing collegues/customers some new features/Worflows. | |
# | |
# | |
# Create Automator -> New -> Quick Action | |
# Add Run Shell Script | |
# Select "Receive input as argument" | |
# paste script | |
read -r -d '' applescriptCode <<'EOF' | |
set dialogText to text returned of (display dialog "Destination filename ~Desktop/*.mp4?" default answer "video") | |
return dialogText | |
EOF | |
filename=$(osascript -e "$applescriptCode"); | |
cmd="/usr/local/bin/HandBrakeCLI -Z 'Gmail Large 3 Minutes 720p30' -i '${*}' -o '${HOME}/Desktop/${filename}.mp4'" | |
echo $cmd | |
eval $cmd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment