#FF00AA

My name is Cédric Bozzi, I make apps and websites, and this is my tech blog — you’ll find news commentary here, from a very opinionated Mac-head.

Il y a une version française ici, but most of this blog’s contents are extracted from my Twitter feed, and hence only available in one language (which varies randomly).

23 oct. 2005

Remember when I explained that any self-respecting (or at least Garoo-respected) webmaster must keep a copy of his sites on his hard disk and edit his files there (and test them locally, if possible) before sending them onto the production server?

The problem is, you end up maintaining two mirrors of the same sites, and every time you want to change a file you have to open the FTP client, find the local copy, find the remote copy, and switch from text editor to FTP with every change in order to upload the file again. So annoying I eventually programmed my own program to automatically upload files to the right place on the server just by pressing a shortcut key in the text editor.

I knew I’d necessarily have to find an OS X equivalent if I wanted to ever work on the Mac (well, that and a Wacom tablet that’s not coming… ah, and being able to share my PC’s WWW directory without it being accessible to everyone without a password — turns out you have to define a password for your guest user: net user guest password after you have enabled the guest account) but I wasn’t in quite a hurry to look for a solution, being too afraid not to find it.

Turns out it’s not only possible, it’s actually quite simple: you only have to install Transmit, configure all your sites as favorites (paying attention to set the correct local and remote paths so Transmit can accurately determine where files are supposed to go), check the “DockSend” checkbox for each site, and… you’re done. Drag and drop files onto the Transmit icon, they’re uploaded to where they belong.

Now you’ll want to get TextWrangler to send its files to Transmit — drag-and-drop is fine for occasional use but quickly becomes a nuisance. Open your Library : Application Support : TextWrangler : Scripts folder, create a Upload Using Transmit.scpt file with this:

set fileName to ""
tell application "TextWrangler"
  save document 1 of window 1
  set fileName to (file of document 1 of window 1)
end tell
tell application "Transmit"
  open fileName
end tell
tell application "System Events"
  set this app to some item of (get processes whose name = "Transmit")
  set visible of this app to false
end tell

Go back to Text Edit, check the Window / Palettes / Scripts menu option, select the newly created script and define a keyboard shortcut.

Explaining it all makes for a pretty long (and boring) post, but it’s so much simpler than learning C# and coding my own program. It works with only a few lines of scripting, and I can now manage my websites without having to move over to the PC’s keyboard. And you have no idea how much that changes everything.

What are you waiting for to get a Mac?

 

Archives

2001   01   02   03   04   05   06   07   08   09   10   11   12  

2002   01   02   03   04   05   06   07   08   09   10   11   12  

2003   01   02   03   04   05   06   07   08   09   10   11   12  

2004   01   02   03   04   05   06   07   08   09   10   11   12  

2005   01   02   03   04   05   06   07   08   09   10   11   12  

2006   01   02   03   04   05   06   07   08   09   10   11   12  

2007   01   02   03   04   05   06   07   08   09   10   11   12  

2008   01   02   03   04   05   06   07   08   09   10   11   12  

2009   01   02   03   04   05   06   07   08   09   10   11   12  

2010   01   02   03   04   05   06   07   08   09   10   11   12  

2011   01   02   03   04   05   06   07   08   09   10   11   12  

2012   01   02   03   04   05   06   07   08   09   10   11   12