Automation Uncategorized

Trigger Scripts Via Dropbox And Hazel

I haven’t found a great use for this yet, but you can have your Mac automatically run a script by simply creating a file/folder in your Dropbox.  To do this, you need to set up Hazel to watch your Dropbox folder for a certain file/folder, and if it appears, trigger a script.  You could also use folder actions, or launchd, but it will be much more challenging.

In the example below, I simply play a sound byte of the Borg claiming that resistance is futile.

Create A Hazel Rule For Dropbox

In my example, if a folder named Borg appears, it should play the sound file.  You could also run whatever script or code you want.


Create The File/Folder From Another Device


From my iPhone, I can simply create a folder named Borg, and within a few seconds (if my computer is on and connected to the Internet) the sound byte will play.

4 replies on “Trigger Scripts Via Dropbox And Hazel”

One use for this that I’m currently investigating is triggering a remote computer to connect to a VPN of my choice. For instance, say I leave my laptop at my office, which doesn’t offer uPNP and thus I can’t VNC into it. I could use my iPhone to use Dropbox to tell the laptop “hey, connect to my home VPN”. And then I can VNC into it.

Leave a Reply