Passing Variables To Hazel From Python

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

Moderator: Mr_Noodle

Passing Variables To Hazel From Python Sun Jan 19, 2020 2:19 pm • by BigPurpleApe
Hazel can pass variables to Python that is called by the external shell command using the filename of the PDF.

Is it possible to send anything back to Hazel from the shell command once the Python script is finished?

My current Hazel rule sometimes has problems reading the person's name because the document I scanned was mailed and the document is folded sometimes on that section of the document. I can almost always read an ID field on the document that my python script can use to pull the person's name. I need to send the person's name back to Hazel so it can rename the PDF using the person's name.
BigPurpleApe
 
Posts: 3
Joined: Wed May 07, 2014 7:18 pm

Re: Passing Variables To Hazel From Python Mon Jan 20, 2020 11:58 am • by Mr_Noodle
No way to do that at the moment. You can try using an AppleScript (which can pass custom attributes back) and have that run the python script and use whatever mechanism you can (screenscrape stdout) to communicate back.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support