Start workflow which requires selected file

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Hi,
I am struggling with a Hazel action that shall watch a particular folder for new PDF files and run a defined Automator workflow (service) on them. Hazel finds matches in the folder but doesn't execute the workflow. My guess is that the problem is that the workflow requires a selected file and I don't know how to make Hazel select that file.

Here is what I have.

Hazel action

Code: Select all
Watch folder "Office"
If all {
Extension IS pdf }
Then do {
Run Automator workflow (PDF to PNG.workflow) }


The workflow is defined as
Code: Select all
Get Selected Finder Items
Render PDF Pages as Images
Move Finder Items (to "Inbox")


I would expect that each new PDF in the folder "Office" will be converted and the newly converted file moved to "Inbox". It all runs nicely when I start the Automator service manually on PDFs in the "Office" folder.

That's the log output for one test action:
Code: Select all
2015-08-17 19:00:35.772 hazelworker[5382] ###main load address: 0x10b358000
2015-08-17 19:00:35.773 hazelworker[5382] ###Noodle load address: 0x10b470000
2015-08-17 19:00:35.773 hazelworker[5382] ###CK load address: 0x10b432000
2015-08-17 19:00:36.248 hazelworker[5382] Processing folder Office
2015-08-17 19:00:38.370 hazelworker[5382] test.pdf: Rule Convert and delete uploaded PDF matched.
2015-08-17 19:00:45.927 hazelworker[5382] Done processing folder Office


Can someone please help me out?

Thanks.

Reiner
ReinerKnudsen
 
Posts: 4
Joined: Mon Aug 17, 2015 12:52 pm

You do not want to use "Get Selected Finder Items" as that will use whatever you happen to have selected in Finder, and not necessarily the file that matched. Get rid of that action. As long as the "Render PDF" action takes a file as input, it should work.
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support