2007/08/04

SendTo Clipboard coolness (TiddlyWiki links to your files)

The SendTo folder is a simple and powerful tool to customize Windows Explorer to simplify some recurring tasks. If you often want to link to files in your PC from your TiddlyWikis, you'll like this hack. It creates two new items in the "Send To" menu:

  • clipboard - file url: Copies to the clipboard the file: url of the file or folder that was showing the "Send To" menu
  • clipboard - new tiddler javascript url: Copies to the clipboard a javascript: url that, when pasted into the address bar of a Firefox tab showing a TiddlyWiki, will create a tiddler with the contents of the file that was showing the "Send To" menu

You can jump and just download and run the thing, a small .hta file, or take less than three minutes watching it in action in one of the lamest screencasts ever:

SendTo Clipboard Screencast from Xavier Vergés and Vimeo

Using it
  • Just download the .hta file and open it. No, wait! Never open .hta files unless you trust its author or you have taken a look at the code.
  • Provided that you trust me or that you have checked the code, you can now open it. Maybe a double click will be enough (your Windows associates .hta files to mshta.exe, a version of IE with high security privileges in your machine). Maybe you need to use the command line and type mshta path2twlink.hta.
  • Follow the simple steps described in the .hta file, and you can start using your new shinny Send To menu items.
  • You are expected to edit the file to customize what gets copied into the clipboard. It should be easy. You may get ideas to push the sendto+clipboard+javascript urls concept further; adding them to the tool should not be too hard.
  • You are also expected to do some dancing, since this is DanceLikeMattHardingWare.
Lessons learned while hacking
  • I initially wanted to use just a .js file. Getting access to the clipboard from a .js file is hard, so I went for an .hta. It turned out to be a good thing, because it ended up providing a way to avoid to the users the trouble of creating the shortcuts by hand and to me the trouble of documenting the recipe.
  • The problem of using an .hta file is that I found no way to keep it invisible, that it has an unusual way to receive its params, and that I had to warn you about its dangerousness.
  • I think that I've spent more time recording the lousy screencast and comparing video hosting services that coding. The number of times that I rerecorded the #@%! thing will remain undisclosed; I have my pride. Regarding the hosting services, after reading about them, I posted the video to google, blip.tv and vimeo.
    I still have no winner, but google's video quality was awfull, so I had to drop it despite its super cool feature of letting you link to a specific point of the video.
    Update: looks like the winner is http://viddler.com: links, comments and tags on specific points of the video, plus the best player of all (in full screen mode, showing the original size, the quality was just perfect): http://www.viddler.com/explore/xdexavier/videos/1

2 comentarios:

Peter dijo...

Very nice, exactly what I was looking for. Thanks!!

DJS dijo...

Thank you very much for this, works like a charm - even six years after you posted the video.