Page 1 of 1

Hazel processes multi-page PDF before scanning is complete

PostPosted: Tue Oct 23, 2012 11:23 am
by mgoldner
I am using OS X's Image Capture application to scan a multi-page document into a single PDF file. However, my Hazel rule begins processing the file as soon as the first page is scanned rather than waiting for the entire scan.

Is there a way to prevent Hazel from processing the file until the scan operation completes?

Re: Hazel processes multi-page PDF before scanning is comple

PostPosted: Tue Oct 23, 2012 12:35 pm
by a_freyer
I'd suggest putting a time limit on your scans. I believe that OSX releases the file after ever page is scanned to prevent losing the whole file if a single page contains an error.

Code: Select all
if (all) of the following conditions are met for the (current file or folder)
    date created is not in the last 5 minutes
    kind is PDF

Do the following to the matched file or folder:
    ...  whatever you  like ...

Re: Hazel processes multi-page PDF before scanning is comple

PostPosted: Tue Oct 23, 2012 12:38 pm
by a_freyer
Alternately, you could add a condition to check if the image capture app is still running, as shown here.

For the passes applescript line:

Code: Select all
tell application "System Events" to return not ((name of processes) contains "Image Capture")


This will run your rules only when you shut down image capture.

Re: Hazel processes multi-page PDF before scanning is comple

PostPosted: Wed Oct 31, 2012 7:03 am
by ilium007
Even simpler - in your hazel rule set a condition so that files not modified in the last xx mins are processed. This way when xx mins is up the file will be picked up.