Skip to content

Instantly share code, notes, and snippets.

@zealot128
Created October 23, 2020 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zealot128/744703de7e43c271012714f50f3a16eb to your computer and use it in GitHub Desktop.
Save zealot128/744703de7e43c271012714f50f3a16eb to your computer and use it in GitHub Desktop.
MacOS Automator: Convert file with Handbrake CLI Quick Action
# 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