views:

72

answers:

2

So I have this idea for a handy little AppleScript which in my opinion would be very handy in speeding up the process of uploading a local file, to its same location on the server.

In other words, you have to specify the home folder on the server and locally, but once that's finished, it would be nice to just press like "Command" + "Shift" "U" for upload or some other hot key combination not in use by OS X for uploading the currently selected file in the Finder.

I find myself needing to do this a lot, and it will save a lot of time!

Someone please tell me if there is an easier way to do this, but I think this will be a good learning experience on top of it all.

I need some help on how I should get started however..

+1  A: 

1) the command line program curl can upload files. 2) if you have a file selected in a Finder window applescript can get the selection. Using those 2 ideas you can automate your task. I don't know the exact curl command but that should be easy to find using google. So you select a file in the Finder and then run the script. The script can be run with a keyboard shortcut as you mentioned or just put it in the Script menu and run it from there.

tell application "Finder"
    set selectedFile to item 1 of (get selection)
    set selectedFile to selectedFile as text
end tell

do shell script "curl -switchesToUpload " & quoted form of POSIX path of selectedFile
regulus6633
A: 

I use Cyberduck which is an ftp client you can set it up so when you double click a file on the server it opens it up in your favorite editor.( textmate is my favorite.) it atuomagiclly downloads and uploads when you save.

this seems like a much better solution to the problem

mcgrailm
what did you end up doing here ?
mcgrailm