- Install ffmepg and gifsicle
brew install ffmpeg gifsicle
- Create the bash script that we'll execute:
vi /usr/local/bin/screengif.sh
i
(insert mode) > Paste contents of screengif.sh >:wq!
(write, quit)- Give the script execute permissions:
chmod +x /usr/local/bin/screengif.sh
- Open
Automator
app in Mac OS File
>New
>Folder Action
- Top right >
Choose folder
> Select your watched directory - Top left search bar >
Run Shell Script
> Drag to right panel - Paste the following:
for f in "$@"
do
if [[ $f == *.mov ]]
then
/usr/local/bin/screengif.sh "$f"
fi
done
Based on: https://github.com/samjhill/screengif