I use Cyberduck for FTP-ing. It’s open source. I want it to have a global hotkey that will upload the file I’m working on, or have selected in the Finder, to the current directory so I don’t have to drag every time.
The current working file of a window is called the “represented file.” You can get the path to it by calling representedFilename of the active NSWindow (I couldn’t figure out how to get the active NSWindow). I didn’t try to find out how to get the currently selected file in the Finder.
Cyberduck is scriptable with AppleScript, I think. It has an “Upload” entry point. See here. It has a single required argument, the path of the file to upload. Wouldn’t it be sweet if you could pass in the path from step #2, and everything just worked?
(Another option for step #3 would be to programmatically drag-drop the active file to the Cyberduck window, but I couldn’t figure out how to do that)
You’ll be better off learning something like AutoHotkey, which will allow you to do that and a lot more to automate your tasks, without the need to modify every program you use.
Figuring out how to do this is now on my list of cool projects to do when I have time. I’d estimate a one in three chance I’ll actually finish this one.
Do you grant random programming wishes or are you only interested in longer term stuff?
Probably. No promises, but I’ll seriously consider any request.
I use Cyberduck for FTP-ing. It’s open source. I want it to have a global hotkey that will upload the file I’m working on, or have selected in the Finder, to the current directory so I don’t have to drag every time.
I don’t know anything about programming Macs, but here are some thoughts for anyone who wants to try this:
DDHotkey can register global hotkeys.
The current working file of a window is called the “represented file.” You can get the path to it by calling representedFilename of the active NSWindow (I couldn’t figure out how to get the active NSWindow). I didn’t try to find out how to get the currently selected file in the Finder.
Cyberduck is scriptable with AppleScript, I think. It has an “Upload” entry point. See here. It has a single required argument, the path of the file to upload. Wouldn’t it be sweet if you could pass in the path from step #2, and everything just worked?
(Another option for step #3 would be to programmatically drag-drop the active file to the Cyberduck window, but I couldn’t figure out how to do that)
I’m not sure how comfortable you are working with Terminal, but this works:
curl -T MyFileToUpload.txt ftp://myusername:mypassword@ftp.myhost.com/directory/
(and can be repeated with two keystrokes: “Up, Enter”)
You’ll be better off learning something like AutoHotkey, which will allow you to do that and a lot more to automate your tasks, without the need to modify every program you use.
Is there anything like it for Mac? AutoHotkey says Windows.
Only what Google can find.
alternativeto.net suggests IronAHK, which apparently works on Mono and has source available.
Figuring out how to do this is now on my list of cool projects to do when I have time. I’d estimate a one in three chance I’ll actually finish this one.
Probably. No promises, but I’ll seriously consider any request.