How to Create a Dropbox / Monitored Folder for Usenet on Mac

Earlier this week, Panic released a new version of my favorite Usenet client for Mac, Unison. With additions such as automatic PAR and UNRAR, smart PAR downloading, a built-in browser for NZB searching, and an interface overall, Unison quickly became the best Usenet client on Mac.

Unfortunately, I feel Unison skipped over one great feature that I’ve requested to them in the past: folder monitoring. Most torrent clients include this feature, and if you’re unfamiliar with the term, folder monitoring basically watches a set folder (usually your downloads folder) for .torrent or other files, automatically opens them, and usually sends the opened file to the trash. The same feature would work great with Usenet’s NZB files.

Creating an NZB Dropbox

Thankfully, Leopard and Snow Leopard include the functionality at the operating system level to make this a reality, which is exactly what I’ve done. I wrote a folder action script, a type of script that runs whenever a file is added, edited, or deleted in a folder. Folder actions are linked at the operating system level and require no additional software to run.

Here are the steps required to setup the dropbox folder action:

  1. Download my folder action script (version 1.1, see changelog) and unzip.
  2. Move the script to: [YourMacHardDrive]/Library/Scripts/Folder Action Scripts/
  3. Right click on the folder you wish to monitor, and select “Folder Actions Setup…” (this may be called something different under Leopard).
  4. On the dialog box that comes up, select the “NZB Dropbox.scpt” option, and click Attach.
  5. Close the Folder Actions Setup window.

After performing these steps, the folder action is ready, and dropping any .nzb in the folder will trigger the action. Here’s a rundown of what happens when a new file is added to the folder:

  • Determines if the file is an NZB, if not, it ignores the file and moves on.
  • Opens Unison in the background if not already open. If the folder action is triggered while you’re working on another application, you won’t even notice Unison open.
  • Adds the NZB to the download queue in the background. Unison will remain hidden and not disrupt your workflow.
  • After a successful import, deletes the NZB file processed.

Using the Script for Other Applications

If you open the script in the AppleScript Editor (an application found your Mac’s Utilities folder), with a little bit of programming knowledge you should have no problem migrating the script for Usenet clients other than Unison, other files and applications (like torrents if your torrent client of choice doesn’t support folder monitor), or even just tweaking the script to remove or add features like trashing the NZB.

Any suggestions are welcomed on improving this script. I’ve been running it successfully for the past few days and it’s been working great for me, but I’m sure there is more that can be done with it.

Dropbox Uses

I’d recommend setting this folder action up on your browser’s download folder, but there are certainly other uses outside of download folder monitor. Look for a new post in the next few days with an excellent use for the script (actually, the main reason why I wrote the script). Until then, feel free to share in the comments what you’re using the script for. Enjoy!

Script Changelog

1.1 (2010-01-20)

  • Added check to ensure file is complete and not still downloading.
  • Added check to verify Unison opened before attempting to add the NZB.

1.0 (2010-01-08)

  • Initial release.

7 Responses to “How to Create a Dropbox / Monitored Folder for Usenet on Mac”

  1. Nice article — thanks for the writing that up .. I like your analytics plugin too although been having issues with asynch tracking in general recently

    We added your link to our Unison review page: http://usenetreviewz.com/unison-review

  2. Been looking for something like this for a while! Cant wait to try thank you

  3. I like this script a lot but I have experienced some difficulties if Unison is already downloading and I am attempting to add an nzb file remotely (over an internet mounted afp share).

    I attempt to copy nzb(s) to the drop box from the remote computer and, due to the bandwith being bused by unison, the copy process is slow which causes an error to pop up in unison before the file is completely copied.

    I didn’t think snow leopard still had a problem for “adding files” actions on folder scripts firing before the file was completely copied. Even so, I put in a delay but I still get errors on occasion.

    • Well, a delay is what I would have suggested, but since you’ve tried that already, I looked into the problem more.

      Check out version 1.1. I added support for verifying the file is downloaded before running and also added an additional check on Unison before opening an NZB.

      I was running into similar problems, so these updates are a benefit to me as well.

  4. I like it even though im a windows man myself but if you need any NZB,s join here http://www.nzb-forum.com hope to see you soon


Trackbacks/Pingbacks