Secure Copy Droplet

It's amazing what you can do with a wee bit of AppleScript. I've been searching for a droplet solution to easily copy images from my Powerbook to my web site. And it occurred to me that instead of spending $20+ for some shareware product, I could just script a solution instead. Here's what I came up with (my first AppleScript, so don't judge too harshly):

property scp_target : "user@host:path/to/images"

on open fileList
  repeat with thisFile in fileList
    set the item_path to the quoted form of the POSIX path of thisFile
    do shell script ("scp " & item_path & " " & scp_target)
  end repeat
end open

This expects that you have a SSH key pair in place already. Edit the 'scp_target' property and use the Script Editor to save this as an application, then put it in your dock. Drag and drop the files you want to copy to invoke it. There's no feedback, but that's how I prefer it. You can add some if you like. Click here to load this into your Script Editor.

A great companion to this is SnapNDrag, a free screen capture, drag-n-drop utility from Yellow Mug Software. Drag and drop from iPhoto works too.

If one were so inclined, they could even create a new weblog entry in a photoblog, referencing the newly uploaded image automatically. Drag and drop publishing!

And of course, this technique will work for any file, not just images.


TrackBack URL for this entry:


As someone who tends to prefer Perl to AppleScript, I like Wilfredo's DropScript. It lets you do basically the same thing, turn a script into a droplet.


This article was published on March 17, 2004 11:52 AM.

The article previously posted was Where's that remote?.

The next article is Breaking your Entries.

Many more can be found on the home page or by looking through the archives.

Powered by Movable Type