Coda has always been a favourite and with version 2, even more. A couple of things is missing though, and I’m always looking for alternative solutions to these thing. In this post I will walk through a solution to add a keyboard shortcut for uploading files in Files view. I seldom can use the publish feature, and the Coda 2 menu option for upload is dynamic. Which means the menu option is not only ”Upload”, it is ”Upload index.html” if index.html is selected. This means you can’t easily add a keyboard shortcut in System Preferences. But i found a different solution, thanks to this guide. I had to change the script a bit but this is how:
1. Open ”Automator”
2. Choose ”Service” for your new document
3. Select ”No input” and Coda 2 as the application
4. Select ”Utiltys” and ”Run AppleScript”
5. Add this code to the script window:
on run {input, parameters}
tell application "System Events"
tell process "Coda 2"
click menu item 1 of menu "Actions" of menu item "Actions" of menu "File" of menu bar item "File" of menu bar 1
end tell
end tell
end run
The script clicks the first item in sub menu ”Actions” in the ”File”menu in Coda. Which happens to be ”Upload […]”.
6. Save (I saved as ”UploadCoda”).
7. The service should now be accessible in System preferences > Keyboard > Keyboard shortcuts
8. Assign shortcut.
Now it should upload selected file(s) in Files view, with command-shift-u.