Last Updated: February 25, 2016
·
645
· luiscielak

Organize screenshots by date

I take many screenshots using Mac OSX's handy shortcut cmd + shift + 4. This will output a png, and save it to the Desktop.

I added the command below to my .bash_profile file, and now when I type organize_screenshots in the terminal, all the screenshot files in the desktop get organized in a screenshots folder that I have under my user directory (~/_screenshots).

Note: this command requires you have exiftool installed by Phil Harvey, an awesome tool to work with file metadata. (http://www.sno.phy.queensu.ca/~phil/exiftool/)

Add the following line to .bash_profile:

alias organize_screenshots='(cd ~/_screenshots && exiftool -R "-Directory<FileModifyDate" -d %Y/%Y%m/%Y%m%d ~/Desktop)'

This is basically doing the following:

  1. Change directory to username/_screenshots folder
  2. Create a folder structure for screenshots based on when they were taken
  3. Move screenshot files from the Desktop to _screenshots folder

The screenshots folder organizes files using the following naming structure:
YYYY/YYYYMM/YYYYMMDD/Screen shot YYYY-MM-DD at HH.MM.png