First let me say Hazel is a great tool and I use it for a lot of things.
Today I wanted to add a presumable simple rule to Hazel: Move files of a special type to a folder on my NAS.
No problem, if the the share on the NAS is already mounted. It just works as with a local folder.
No problem either, if the share is not mounted and I'm fine, that the rule gets delayed until I mount the share.
But very difficult, if I want it happen immediately and keep the mounted/unmounted state of the share.
Yes, I could run a shell script to check, whether a /Volumes/sharename folder exists and mount it via shell script or Applescript, if not.
In addition to the hassle in having to deal with shell scripts / Applescripts, there are some hiccups:
1.) Ideally the script should run only before the first move action, afterwards the share is already mounted.
2.) Testing for the existence of a /Volumes/Sharename folder doesn't mean the correct share is mounted. I.e I often have a /Volumes/peter share mounted from another computer, when I've mounted my home folder from that machine.
3.) Ideally the share should be unmounted after the rule, but only if it was't already mounted before.
While there are other special usecases, this behavior is what people usually expect when moving files to a NAS with Hazel.
I'd like to see a checkbox "auto-mount/unmount" in the copy, move actions etc., whenever I choose a destination folder that is located on a network drive. When checked, Hazel should silently mount the correct network drive after the first match in case it is not already mounted and unmount it at the end of the rule in case it had mounted the network drive before. For AFP, SMB shares Hazel could rely on the keychain to do the authentication.
In case this goal can be reached with a workaround in the current version, I'd be happy to hear about.
Cheers
Pete