Page 1 of 1

Using Hazel and Transmit to upload matched files via FTP

PostPosted: Tue Dec 18, 2012 6:40 pm
by automatic
I just spent a good two hours researching this online and was rather surprised to find how little has been written on this topic around the web.

I expected a search for "FTP" here on the forums to yield the answers I seek, but no such luck!

Googling, as it turns out, shows this as being the most popular result for my problem: http://doingthatwrong.com/home/2012/5/1 ... -bash.html

And indeed, that comes close to what I'm trying to do. But not quite.

First off, I'm trying to solve this using Transmit's Upload Automator action. In fact, my solution works. Let me back up a moment and describe my scenario.

I want torrent files to be uploaded to a server. So here's what my rule looks like:
ImageClick for large view - Uploaded with Skitch

The Automator workflow is very simple and contains only one step: Transmit's Upload action.

Now this actually works perfectly. The problem lies with HOW it works. For every torrent file found, it seems Hazel launches the workflow once. Now, the workflow launching causes the Transmit window to pop up, a connection to be established and then the file to be uploaded. And it does this on a per-file basis. It's a mess. With n matched files, the workflow is executed n times. Now I'm wondering... where does this limitation come from? Hazel or Automator? Or even the Upload action?

Here's what I want: the solution above, but with Hazel passing ALL matched files AT ONCE to the Automator workflow. No matter how many matched files there are, they should all be uploaded together, not one by one.

Any ideas?

If this isn't possible with the setup I describe, I very much welcome suggestions. Surely, this can be achieved by scripting. Hints/tips regarding this would be very welcome.

Thanks in advance!

Re: Using Hazel and Transmit to upload matched files via FTP

PostPosted: Wed Dec 19, 2012 10:56 am
by Mr_Noodle
It's how Hazel works. Hazel processes the file, it matches a rule, it executes the actions on that file. Hazel does not do it in a batch for various reasons, that I won't go into now except that if it did, people would be complaining that it's doing things in batch or complaining about other subtle issues related to that.

If you can get all the files into a folder, you can have Hazel then match that folder and have that processed as one unit. Otherwise, you might have to do a script to pull this off in this way.