FREN

#FF00AA


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?

Want to know when I post new content to my blog? It's a simple as registering for free to an RSS aggregator (Feedly, NewsBlur, Inoreader, …) and adding www.ff00aa.com to your feeds (or www.garoo.net if you want to subscribe to all my topics). We don't need newsletters, and we don't need Twitter; RSS still exists.

Yarrow, 7 years ago:

ben j'utilise Dreamweaver sur Mac (après l'avoir utilisé sur PC d'ailleurs) et il fait tout ça...

garoo, 7 years ago:

Pff... Dreamweaver... so 1999...

Lionel, 7 years ago:

Tu utilises TextWrangler ? Je n'arrive pas à me décider pour un bon éditeur, et ça m'agace.
Je suis passé par BBEdit, TextWrangler, SubEthaEdit, skEdit, Smultron, TextMate pour ne citer que les meilleurs, et j'oscille entre les 2 derniers, Smultron est sympa, gratuit mais limité comparé à TextMate que j'utilise en ce moment, mais qui fait un peu usine à gaz... J'adore skEdit, mais inutilisable tellement il est buggé.
Tu as fait ce chemin de croix aussi ?

garoo, 7 years ago:

J'ai fait le tour de ce qui existait, oui mais je ne demande pas grand chose à un éditeur -- juste qu'il ne plante / rame pas sur les gros fichiers (ça élimine Smultron) et qu'il fasse le syntax highlighting -- donc je n'ai pas trop regardé les éditeurs payants. Je pars du principe que ça doit être des usines à gaz, et TextWrangler me suffit, même si l'interface fait un peu trop OS9 à mon goût.

Mais j'avoue que TextMate m'intrigue, leur page web fait bien geek comme il faut. Je ne sais plus si je l'ai déjà testé, je vais voir ce que ça donne.

K, 7 years ago:

Incroyable ce mot : highlighting.

Lionel, 7 years ago:

C'est vrai que niveau interface, ça fait peur... En plus, j'ai retiré tout ce qui était métal brossé dan

Lionel, 7 years ago:

(je te laisse rassembler ces 2 commentaires, désolé pour la fausse manip)
dans mon système, et là BBEdit et TextWrangler ne supportent pas du tout le lifting !
Dis-moi ce que tu penses de TextMate quand tu l'auras testé. :-)

garoo, 7 years ago:

Je sais pas trop. L'interface est sympa (sauf que j'arrive pas à trouver comment on ouvre les fichiers dans des tabs) mais j'aime bien le fait que TextWrangler ait une floppée de préférences. Et j'arrive pas à lui faire envoyer les fichiers vers Transmit.

Lionel, 7 years ago:

Pour ouvrir un fichier dans un onglet, je n'ai trouvé que la méthode suivante : toujours ouvrir des Projets et glisser le fichier à ouvrir dans le tiroir...
Mais la plupart du temps je glisse le dossier qui contient tous mes fichiers sur TextMate, et il les ouvre en respectant l'arborescence (on peut même ensuite rajouter ou supprimer des fichiers ou des dossiers directement depuis le tiroir avec le menu contextuel).

garoo, 7 years ago:

Ah, pas mal, du coup. Mais mes fichiers sont sur un autre ordinateur, et quand je glisse le dossier d'un site sur TextMate il met cinq minutes à réagir.
Enfin, c'est pas un drame, non plus, je pourrais m'y faire. Faudra que je regarde si j'arrive à le faire communiquer avec Transmit.

Yarrow, 7 years ago:

Mon Dreamweaver il date de 2002 d'abord !
Et il plante pas du tout... sérieusement, tu n'aimes pas l'interface, où un autre truc te manque dans le programme ?

garoo, 7 years ago:

J'aimais bien l'interface, quand j'avais testé, mais c'est utiliser un logiciel wysiwyg pour faire ses sites web qui est passé de mode.

Legal information: This blog is hosted par OVH, 2 rue Kellermann, 59100 Roubaix, France, www.ovhcloud.com.

Personal data about this blog's readers are not used nor transmitted to third-parties. Comment authors can request their deletion by e-mail.

All contents © the author or quoted under fair use.