<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: TextWrangler code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 25 Jul 2008 10:37:59 GMT</pubDate>
    <description>DZone Snippets: TextWrangler code</description>
    <item>
      <title>Compile the front TextWrangler java source file using applescript</title>
      <link>http://snippets.dzone.com/posts/show/1205</link>
      <description>// If you use TextWrangler to edit java source code,&lt;br /&gt;// this AppleScript will compile the front window.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;tell application "TextWrangler"&lt;br /&gt;	set the_file to file of text document 1&lt;br /&gt;end tell&lt;br /&gt;&lt;br /&gt;set AppleScript's text item delimiters to ":"&lt;br /&gt;set source_file to the last text item of (the_file as string)&lt;br /&gt;&lt;br /&gt;tell application "Finder"&lt;br /&gt;	set the_folder to container of the_file as alias&lt;br /&gt;end tell&lt;br /&gt;&lt;br /&gt;tell application "Terminal"&lt;br /&gt;	activate&lt;br /&gt;	set shell_script to "cd " &amp; (quoted form of POSIX path of the_folder) &amp; "; javac " &amp; source_file&lt;br /&gt;	if (count windows) is 0 then&lt;br /&gt;		do script shell_script&lt;br /&gt;	else&lt;br /&gt;		do script shell_script in the front window&lt;br /&gt;	end if&lt;br /&gt;end tell&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 20 Jan 2006 00:34:48 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1205</guid>
      <author>georgesb (George Benainous)</author>
    </item>
  </channel>
</rss>
