Hazel

I want to stop Hazel then unmount the external drive that it uses for storage. I also want to do the reverse, so when that drive appears Hazel gets started.

They work fine if I try them from within KM. As soon as I quit KM they always fail.

Can anyone suggest anything?

I had to use the find image to click on the right tab as that had a similar problem, it doesn't abort if it fails as if that tab is already active it's inverted and so won't match.

DOH!

Never mind.

I added a pause between the activate and the press and that seems to have done the job. Weird it worked every time I did it from KM and failed every time I did it normally.

Hey Mark,

You don’t need to fiddle with the preference pane.

This AppleScript will toggle the Hazel helper-app off/on.

tell application id "com.noodlesoft.HazelHelper"
  if it is running then
    tell it to quit
  else
    tell it to run
  end if
end tell

You can of course break that up into an on script and an off script.

One thing about this method that concerns me is there doesn’t seem to be a way to tell if it’s busy or not.

-Chris

I find this one very useful.Thank you.

About the business of Hazel; is it impossible to check if Hazel Worker is running?
It seems that the Worker runs only when Hazel is busy. The, quite based on that condition.

This should work (the tell part is @ccstone’s script from above):

if (do shell script "pgrep 'hazelworker'; exit 0") is "" then
  display dialog "‘hazelworker’ is not running. Continue?"
  tell application id "com.noodlesoft.HazelHelper"
    if it is running then
      tell it to quit
    else
      tell it to run
    end if
  end tell
end if

This is great–thank you

The with Hazel I have achieved with a context menu from BetterTouchTool and Keyboard Maestro. Is also an elegant solution for. Here a Video:sunglasses:

ugh... after an hr figured this out... ;p

Here is the macro for anyone wants it.Hazel Start System Pref.kmmacros (7.0 KB)

Link dead :sob:

Hi @politicus, unfortunately I also do not know more what I posted there :pleading_face:

I myself now use the AppleScript hosted by @ccstone.

As far as the workflow for Hazel is concerned, I use this one regularly:

2019_08_06_Support_2

The macros consist partly only of KM actions or also with integrated scripts:

2019_08_06_Support_3