<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Oct 22, 2006, at 8:18 AM, Andy Herbert wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I've been trying to come up with a solution to creating shell scripts within Textmate and creating a widget on the Dashboard layer to call the script with references to any files or URLs passed to it, and I have eventually come up with a Textmate widget & bundle to do all this.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I've created a screencast (sorry - no audio) to show the various features of the bundle and the widget, and it can be found at:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://homepage.mac.com/andy.herbert/Textmate-widget.mov">http://homepage.mac.com/andy.herbert/Textmate-widget.mov</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Features shown in the screencast include:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">The actual widget is included inside the bundle and is installed in ~/Library/Widgets/ the first time you call the bundle command to create a new widget using the currently opened document.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">To call a script using the widget click on the Textmate icon, to pass files to the script as $1, $2.. etc drag files from Finder on to the Textmate icon, you can also drag a URL on to it if you have a web-browser open, this too is passed as $1.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">If when the script is called there is any output a green icon will appear on the widget, and when this is clicked you will be able to view the output log, same goes with any errors the script throws up, except this time the icon is red.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Flipping the widget over will allow you to edit the widget's label or modify the script the widget uses. All scripts used by the widget are held in ~/Library/Application Support/Textmate/Widget Scripts/ and are deleted when you remove the widget.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Both the output and error logs are stored in ~/Library/Logs/, each widget has a separate file, and is deleted and re-created each time each script is called.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">The widget bundle can be found at:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://homepage.mac.com/andy.herbert/Widget.tmbundle.zip">http://homepage.mac.com/andy.herbert/Widget.tmbundle.zip</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I hope it might be useful to someone else on this list.</DIV></BLOCKQUOTE></DIV><BR><DIV>This looks like it's going to be totally stinking awesome.</DIV><DIV>One problem from the getgo however.</DIV><DIV>I want to use existing scripts that already have names and stuff without being deleted when closing the widget.</DIV><DIV>Can you make it link to existing scripts easily?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><B>Link open document into new widget</B></DIV><DIV>and then change the existing one to:</DIV><DIV><B>Copy open document into new widget</B></DIV><DIV><BR><DIV>Something like that.</DIV><DIV>Yes, i know i could just call the existing script from the temporary widget script, but that's a whole extra unnecessary layer.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This is going to be totally awesome!</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>thomas Aylott — <B>subtleGradient </B>— CrazyEgg</DIV><DIV><BR class="khtml-block-placeholder"></DIV></DIV></BODY></HTML>