Trigger Scripts Via Dropbox And Hazel

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.