This is a grrrreat "plugin" and shows just how plain awesome the extensibility of TextMate is!!!
I had to change 'ruby' to '/usr/local/bin/ruby' to get the command to work. In command line even 'ruby' worked but when launched from TextMate, ruby was not found. This is probably an issue with the non-interactive/interactive shells that has been discussed before. Anyway, putting the whole path into the command helped.
The command also puts a newline character after the color value. This can be avoided by recording a macro where you: 1) Invoke the command. 2) Click right-arrow. 3) Click backspace.
This gets rid of the newline so you can add the semicolon right after the hex value ;-)
//jarkko
On 24.11.2004, at 21:34, Allan Odgaard wrote:
On Nov 24, 2004, at 20:13, Allan Odgaard wrote:
I made a quick little command for TextMate that shows a color picker, and inserts the hex value.
Cool! :) Though you may want to mention that it requires Ruby 1.8.
And for those w/o Ruby 1.8 here's a version which uses awk for the formatting:
osascript -e 'tell application "Finder" to activate' -e 'tell application "Finder" to choose color'|tr -d ,|awk '{printf("#%02x%02x%02x", $1/256, $2/256, $3/256)}'
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/mailman/listinfo/textmate
-- Jarkko Laine http://jlaine.net