Last updated: 2014-12-25
mdfind -attr kMDItemContentType "kMDItemContentType == '*'" -onlyin . | awk -F"kMDItemContentType =" '{print $2}' | sort | uniq -c | sort -r
DROPBOX_WORK=$(python -c "import json;f=open('$HOME/.dropbox/info.json', 'r').read();data=json.loads(f);print data.get('business', {}).get('path', '')")
DROPBOX_PERSONAL=$(python -c "import json;f=open('$HOME/.dropbox/info.json', 'r').read();data=json.loads(f);print data.get('personal', {}).get('path', '')")
DROPBOX="$HOME/Dropbox"
LAST_ADDED=$(mdfind \
-onlyin "$DROPBOX_PERSONAL" \
-onlyin "$DROPBOX_WORK" \
-onlyin "$DROPBOX" \
'kMDItemDateAdded >= $time.today(-1)' \
-attr 'kMDItemDateAdded' | \
awk -F"kMDItemDateAdded =" '{print $2 "|" $1}' |
sed -e 's/^ *//' -e 's/ *$//' |
sort -r | \
cut -d'|' -f2 | \
head -n5)