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.

borg-dropbox-hazel

Create The File/Folder From Another Device

create-folder-name

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 to “Trigger Scripts Via Dropbox And Hazel”

  1. 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