Scan and Sort

From your noodle to other noodles. Talk about ways to get the most from Hazel. Even exchange recipes for the cool rules you've thought up. DO NOT POST YOUR QUESTIONS HERE.

Moderators: Mr_Noodle, Moderators

Scan and Sort Fri Jan 19, 2018 12:05 pm • by brandonshutter
Hey all!
I scan every document I ever get, and have hazel sort it all for me.
Here's my workflow now:
I have a scanner that has the option to upload to different "users" via ftp(receipts, invoices, brandon, bills) etc.

I run the following bash script every 1 minute:
Code: Select all
#!/bin/sh
 
users="karla brandon receipts docs bills invoices pictures"
wget_dir="/home/"
server="111.111.111.111"
dropbox="/Users/shutter/Dropbox/Scans/Imports/"

# Perform backup
for user in $users
do
        rsync -avzhe ssh ${user}@$server:/$wget_dir/${user} $dropbox/
done


Hazel is looking into those folders and doing the following:

Image

The goal is to make a copy of the pdf in a specific folder, sorted by year/date/month, and then renamed, and then have Finder open it.
Here's a log of a successful action:

Code: Select all
2018-01-19 10:58:04.336 hazelworker[25134] ###main load address: 0x108ca5000
2018-01-19 10:58:04.337 hazelworker[25134] ###Noodle load address: 0x108dc4000
2018-01-19 10:58:04.337 hazelworker[25134] ###CK load address: 0x108d89000
2018-01-19 10:58:04.418 hazelworker[25134] Processing folder receipts
2018-01-19 10:58:06.463 hazelworker[25134] NeatConnect_01_19_2018_15_57_45.pdf: Rule Sort Receipts matched.
2018-01-19 10:58:06.464 hazelworker[25134] [File Event] File copied: NeatConnect_01_19_2018_15_57_45.pdf copied from folder /Users/shutter/Dropbox/Scans/Imports/receipts to folder /Users/shutter/Dropbox/Scans/Receipts.
2018-01-19 10:58:06.465 hazelworker[25134] [File Event] File moved into subfolder: /Users/shutter/Dropbox/Scans/Receipts/2018/NeatConnect_01_19_2018_15_57_45.pdf sorted from folder /Users/shutter/Dropbox/Scans/Receipts to subfolder 2018.
2018-01-19 10:58:06.465 hazelworker[25134] [File Event] File moved into subfolder: /Users/shutter/Dropbox/Scans/Receipts/2018/01/NeatConnect_01_19_2018_15_57_45.pdf sorted from folder /Users/shutter/Dropbox/Scans/Receipts/2018 to subfolder 01.
2018-01-19 10:58:06.466 hazelworker[25134] [File Event] File moved into subfolder: /Users/shutter/Dropbox/Scans/Receipts/2018/01/19/NeatConnect_01_19_2018_15_57_45.pdf sorted from folder /Users/shutter/Dropbox/Scans/Receipts/2018/01 to subfolder 19.
2018-01-19 10:58:06.466 hazelworker[25134] [File Event] File renamed: /Users/shutter/Dropbox/Scans/Receipts/2018/01/19/NeatConnect_01_19_2018_15_57_45.pdf renamed to /Users/shutter/Dropbox/Scans/Receipts/2018/01/19/15_57_45.pdf.
2018-01-19 10:58:08.878 hazelworker[25134] Done processing folder receipts



This allows me to have a folder structure of the year/month/date/filename.

Works super well, and it's nearly instant!
brandonshutter
 
Posts: 1
Joined: Fri Jan 19, 2018 11:39 am

Return to Tips & Tricks - DO NOT POST QUESTIONS

cron