Zip & Share

May 14th, 2012

In both my work and personal life, I regularly need to share files with others, and the best and most flexible method that I have found is through Dropbox’s excellent Public folder. There are several limitations to this method however:

  1. Files in your Dropbox folder aren’t secure, and are publicly searchable;
  2. Files in your Dropbox folder become stale and require regular deletion to not consume your space and create clutter;
  3. Getting a group of files into your Dropbox and sharing it with others is a tiresome process if done regularly.

To tackle these limitations, I combined the power of Keyboard Maestro with the persistence of Hazel,  creating a very powerful and secure method for combining, sharing, and maintaining your shared files. Here’s how it works.

Initial Setup

First you’re going to need Dropbox, Hazel, and Keyboard Maestro. Those are mandatory.

With that productivity trifecta installed, browse to your Dropbox Public folder and create 5 different folders called 1,3,7,14, and 30. I put these folders into a folder called Temp in my Dropbox/Public folder, just to clean things up. These folders represent the amount of days that a file in that folder will be available.

To achieve this, launch Hazel and create a single rule for each of the folders so that if Date Added is not in the last X days, Hazel will move the file to Trash. See the screenshot on the right.

From then on, Hazel will take care of the file maintenance in those folders after the specified amount of time has passed. Now let’s make it simpler to put files into our newly maintained folders.

To save extra time and clicks, I created a Keyboard Maestro macro from a simple window allows me to:

  1. Compress the selected Finder files into a single zip file;
  2. Name the file as I wish;
  3. Select a duration for the file to be shared ;
  4. Randomize the file name, if needed, via Merlin Mann
  5. Password protect the zip, if needed, via Kaushik Gopal

With those options set, Keyboard Maestro creates a zip file accordingly and move it into the correct folder Public/Temp folder in my Dropbox, and puts the public URL on my clipboard, displays an informative Growl notification.

The Keyboard Maestro macro is available for download here (now version 1.1, see below).

Finalize the script by adding your own Dropbox ID and path to your newly created Dropbox/Public/Temp folder. If you find any bugs, or have any feature requests/improvement suggestions, please let me know.

I just finished this script last night, although I have been using a version of it for over 6 months, almost on a daily basis. The final pieces were put in place by Kaushik Gopal, who wrote the brilliant KM Macro/AppleScript to compress, and password protect multiple files while randomizing the file name.

Update – May 20, 2012: Zip & Share v1.1 released: fixed a bug preventing the zip from being password protected (if selected). Also cleaned up a bit of the AppleScript. Thanks again to Kaushik Gopal who helped me catch these issues.

See all my Keyboard Maestro posts.

  • Pingback: Web excursions: May 19, 2012 - May 23, 2012 - Brett Terpstra()

  • Pingback: Keyboard Maestro Zip and Share [Link] « Macdrifter()

  • http://www.wellenspeicher.de/ madnil

    Excellent! Works very well. Thank you.

    I called my “root” folder ZipShare instead of Temp. For this I had to change the folder name in the variable “dropurl”.

  • Ifba

    Terrific!  Thank you!

  • Pedro

    Amazing. Well done and thank you for putting all this together. 

  • Pingback: Zip & Share()

  • http://www.facebook.com/philipp.monihart Philipp Monihart

    The Link for the updated script is “doubled”
    should be: http://dl.dropbox.com/u/19133/blog/Zip %26 Share1.1.kmmacros.zip

    • http://www.eugenegordin.com/ Eugene Gordin

      Thank you Philipp – nice catch. Fixed.

  • Andrea

    I tried out this macro, and I found an issue: if you use it on a tree of subfolder, the folder structure will actually be flattened by the use of the -j option for the zip command. What’s worse, it is possible that the macro will fail in this cases, due to the possibility that the subfolder contain files with the same name (for example the .DS_store files).
    I modified the applescript actions to try and resolve this issue; if you’re interested let e know

Simply Apple
Simply Apple

Check out my weekly Simply Apple podcast, covering news, views, apps, and solutions in the world of Apple.

Subscribe on iTunes
Subscribe elsewhere

my writing

my website is a collection of my work and writing since 2004, so please don't be surprised if things seem a little outdated, particularly in the technology section. That said, the concepts behind most posts should be interesting given all that's happened since they were written so enjoy!