It's interesting how you can forget things.
I needed a ruby script to extract a texture file from a SketchUp texture. So I started searching around and found this thread.
http://www.sketchucation.com/forums/scf/viewtopic.php?f=115&t=1087
But SURPRISE! It turns to to be a script that I wrote and sent to Didier for distribution. (rps_texturewrite.rb)
I was looking for a script to extract a single texture, so I modified rps_texturewrite.rb to extract the texture from a selected face (or other entity),
and ask you where you want to save it.
When you load it (or put it in the plugins folder), it adds two commands to the plugins menu:
Export Textures- this saves all the raster images for textures in your model to a folder called 'texture_test' in your temporary folder.
Export Selected Texture - This exports the first texture it finds in the current selection and asks you where to put it.
(I put this here instead of the ruby forum because people may want to extract textures from materials without getting involved in ruby scripts)
[EDIT Aug 30, 2012 - replaced rps_texturewrite.rb with a version which works better]
rps_texturewrite.rb