Skip to content

Instantly share code, notes, and snippets.

@toshinarin
Created July 14, 2014 03:19
Show Gist options
  • Save toshinarin/309f14306d67df3a8a13 to your computer and use it in GitHub Desktop.
Save toshinarin/309f14306d67df3a8a13 to your computer and use it in GitHub Desktop.
Save screenshots to another folder on Mac
#!/bin/bash
TARGET_FOLDER="${HOME}/Pictures/screenshot"
FILE_PREFIX="s"
echo "setting..."
if [ ! -d ${TARGET_FOLDER} ]; then
mkdir -p ${TARGET_FOLDER}
echo "${TARGET_FOLDER} is made."
fi
defaults write com.apple.screencapture location "${TARGET_FOLDER}"
defaults write com.apple.screencapture name "${FILE_PREFIX}"
killall SystemUIServer
echo "finished."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment