[TxMt] services menu

Fred B fredb7 at gmail.com
Fri Dec 29 12:24:47 UTC 2006


On 12/29/06, Fred B <fredb7 at gmail.com> wrote:
> You can use ThisService[1] to create your own services from any script.
>
> [1]: http://wafflesoftware.net/thisservice/
>
> I don't have much time now, but here is a quick script to open
> selected text in TM:
>
> ✂------✂------✂------✂-----
> #!/usr/bin/env ruby
>
> path = "/tmp/tempText_" + `date "+%d-%m-%G_%H-%M-%S"`.chomp
> text = <<YOUzWONTzMATCHzTHISzEVA
> #{STDIN.read}
> YOUzWONTzMATCHzTHISzEVA
>
> f=File.new(path, "w")
> f.puts text
> f.close
> `open -a TextMate "#{path}"`
> ✂------✂------✂------✂-----
>
> Save it in a file, select this file in ThisService, choose Type "both"
> and eventually create a shortcut. Voilà.
>
> BTW, are you aware of the "Edit in Textmate" input manager[2]? It is a
> much better solution for editable text.
>
> [2]: http://macromates.com/textmate/manual/using_textmate_from_terminal#cocoa_text_fields
>
> You can find various contextual menus to do those kind of things in
> the repository[2]
>
> [3]: http://macromates.com/svn/Bundles/trunk/Tools/CM/
>
> --
> FredB
>

Ooops. You should choose Type "Act on Input" instead of "Both". Sorry.

--
FredB
http://geekthang.com


More information about the textmate mailing list