Skip to content

Instantly share code, notes, and snippets.

View samwightt's full-sized avatar

Sam Wight samwightt

View GitHub Profile
@samwightt
samwightt / main.sh
Created May 22, 2018 21:52
Script to organize files based on their creation dates in Hazel. Can be wrapped in a for loop to target multiple files outside of Hazel.
# $1 is the path to the file that you want to move. This is automatically set in Hazel on Mac.
# If you're not using this with Hazel, uncomment the line below and set the file's direct path.
# 1=file/path/here
# If you're using this with a different type other than pdfs, change all occurences of *.pdf in the file to *.ext,
# where .ext is the extension of the file type you are targeting.
# Variable to store directory structure.
date=`date -r "$1" +%Y/%b/%d`