Page 1 of 1

Recursive directory matching + Run Automator Workflow – Help

PostPosted: Mon Apr 09, 2018 4:44 pm
by r00p
Hi –

I hate to admit that I'm so dense that I just don't get the logic, but here's what I'm trying to do:

• I have a website directory with scores of subdirectories.
• In each subdirectory, there are dozens of PDFs
• I want to make a plaintext version of each PDF
• I want the plaintext versions to be created in place, right next to their source PDFs

At first I thought could accomplish this solely with Automator, but I can only get it to convert one PDF to plaintext at a time (and there are over a thousand) Then I thought I could get Hazel to easily help me, so I made this Hazel workflow:

Root Folder->

1) Get Root Folder Contents Recursively
-> If all conditions:
- Kind is Folder
-> Do the following
- Run rules on folder contents

2) Find all the PDFs, Convert to TXT
-> If all conditions:
- Kind is PDF
-> Do the following:
- Run Automator workflow

{Extract PDF Text Hazel.workflow}

https://www.dropbox.com/s/zl9vtkw1n9zzm ... rkflow.png

Image

Sadly, this hangs on the first folder/file, and just outputs a single blank plaintext file.

BUT, if I modify Hazel to COPY all the recursive directory structure PDFs it finds, then I can easily run the workflow against that single directory by selecting all files at the dialog window, and the conversions are all done in a snap! So, I must be missing something obvious here – either in the Automator workflow applet, or the Hazel configuration.

If anyone could help, I'd sure appreciate it.

- Rupert

Re: Recursive directory matching + Run Automator Workflow –

PostPosted: Tue Apr 10, 2018 11:35 am
by Mr_Noodle
Get rid of the first action in your Automator workflow. Hazel passes in the file so asking Finder for it will just have the workflow ignore that.

Re: Recursive directory matching + Run Automator Workflow –

PostPosted: Tue Apr 10, 2018 4:00 pm
by r00p
Mr_Noodle wrote:Get rid of the first action in your Automator workflow. Hazel passes in the file so asking Finder for it will just have the workflow ignore that.


Thanks for your reply, but I must be really dense because it still didn't work. Nothing happens. I couldn't even see anything in the Hazel log. Then I noticed something funny – my Hazel folder icons were changing, and didn't quite look right (like the default macOS "Downloads" folder with its down arrow icon) When I hover over any of the Hazel target folders, it shows a completely erroneous Finder path. So, I think I have an even bigger problem on my hands. I tried creating a new, default Hazel folder routine, and still the folder I choose in the Finder via Hazel doesn't end up being the one that Hazel saves. Is it possible that my whole Hazel setup is FUBAR?

I sure hope there's some way other than memory & screenshots to save all the Hazel folder actions I've setup – it took me a LONG TIME to learn and refine those, and I don't really look forward to doing it all again.

=(

Screenshots:

https://www.dropbox.com/s/utv8jspc6yr6c21/Backups-Archive_Becomes_Staging.png

https://www.dropbox.com/s/hu8desfyepx1mez/Downloads_Becomes_Archives.png

https://www.dropbox.com/s/5ad5ybhpbduolle/Staging_Becomes_Masters.png

Re: Recursive directory matching + Run Automator Workflow –

PostPosted: Wed Apr 11, 2018 10:39 am
by Mr_Noodle
Are these all happening on the booter drive? If so, can you tell me more about it? Is it an external drive? Network share?

Also, does this continue to happen after a reboot?

Re: Recursive directory matching + Run Automator Workflow –

PostPosted: Wed Apr 11, 2018 1:39 pm
by r00p
Mr_Noodle wrote:Are these all happening on the booter drive? If so, can you tell me more about it? Is it an external drive? Network share?

Yes, this was all on the internal SSD boot drive, "booter"

Also, does this continue to happen after a reboot?


No. I finally got a clue, and quite panicking, and after a reboot, everything's back to normal. The Hazel & Automator workflow combo now also works just fine. (More updates on that soon)

Thanks for checking in. ;)