As you've mentioned previously, Hazel kind of works in an an asynchronous way. 'killing' it from the Terminal has also been mentioned to be 'bad'... So there are two reasons why Hazel should be open to CLI:
(1) My workflow, remoting into a Mini, which I'll explain, and
(2) To make Alfred or Automator (HotKey, Service Menu) Workflows which can be invoked via CLI glue.
So: (1)
When I'm working on my my remote Mini, via *two* crappy, latent ISP connections, I need all the speed I can get. If I upgrade/trash a bunch of Apps, I don't need Hazel running its 'okay now scan trash and throw that dialog' when I'm remoting in from 200 miles away. So there's a whole 'Go to SysPrefs, turn off Hazel, do work'... all being done at 10 frames per second tedious SLOW. The rest of the work at that speed is too.
I've mitigated a LOT of this with Otto. I can run automator actions or CLI without ssh'ing in (Otto uses iCloud to pass commands to the right machine regardless of remote ip address!!). So I'm able to 'semi-automatically' use Otto to queue software downloads and even move files into folders that (when I turn it back on, yup via Otto) Hazel can process. This. is. really. nice. and. powerful. Which brings me to number 2:
(2)
If I have CLI glue, I can
also make triggers that I can invoke from Alfred *and/or* the Services Menu,
locally. Meaning I can also make 'hot key' bindings. Here's a MESSY shell script to kill DropBox I made:
- Code: Select all
#!/bin/bash
killall Dropbox
/usr/local/bin/growlnotify -m "Otto DB Kill fired."
DropBox doesn't 'mind' being killed, as the files will be re-sync'd and conflicts addressed. But if Hazel needs 'graceful exit' then when I make this script for Alfred:
- Code: Select all
#!/bin/bash
hazel -stop
/usr/local/bin/growlnotify -m "Hazel has been stopped"
..start would be the same, and for the stat command, off the top of my head, this:
- Code: Select all
#!/bin/bash
/usr/local/bin/growlnotify -m < echo | hazel -stat
to return the status... My shell-echo redirect is a bit rusty.
I hope this makes sense. If the feature is implemented, I'd first use it with Otto, then make Alfred commands in short order. For automator Service menu-hotkeys, the command might take this form:
See a mock here:
https://www.dropbox.com/s/u9l6kv6x9xjb2vj/Hazel_Automator_mock.pngI hope this makes sense...
