<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ug Media</title>
	<atom:link href="http://www.ugmedia.com.au/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ugmedia.com.au</link>
	<description>Biodiversity information technology and wildlife photography</description>
	<lastBuildDate>Thu, 09 Feb 2012 05:45:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Changing colour schemes in BBEdit</title>
		<link>http://www.ugmedia.com.au/2011/02/08/changing-colour-schemes-in-bbedit/</link>
		<comments>http://www.ugmedia.com.au/2011/02/08/changing-colour-schemes-in-bbedit/#comments</comments>
		<pubDate>Tue, 08 Feb 2011 23:54:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.ugmedia.com.au/?p=68</guid>
		<description><![CDATA[John Gruber http://daringfireball.net/projects/bbcolors/ tell application "System Events" set bbOpen to (name of processes) contains "BBEdit" end tell if bbOpen is true then tell application "BBEdit" to quit end if set btnSet to {"Cancel", "Light", "Dark"} set prompt to "Do you want light or dark colours?" set dlgResult to display dialog prompt buttons btnSet default button [...]]]></description>
			<content:encoded><![CDATA[<p>John Gruber</p>
<p>http://daringfireball.net/projects/bbcolors/</p>
<pre>
tell application "System Events"
   set bbOpen to (name of processes) contains "BBEdit"
end tell

if bbOpen is true then
   tell application "BBEdit" to quit
end if

set btnSet to {"Cancel", "Light", "Dark"}
set prompt to "Do you want light or dark colours?"
set dlgResult to display dialog prompt buttons btnSet default button {"Dark"}

set btn to button returned of dlgResult
if btn is "Light" then
   set colourFileName to "Defaults"
else if btn = "Dark" then
   set colourFileName to "Gruber Dark"
end if

set shellScript to "bbcolors -load " &#038; quote &#038; colourFileName &#038; quote
do shell script shellScript

tell application "BBEdit"
   activate
end tell
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ugmedia.com.au/2011/02/08/changing-colour-schemes-in-bbedit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using R and BBEdit</title>
		<link>http://www.ugmedia.com.au/2010/12/12/using-r-and-bbedit/</link>
		<comments>http://www.ugmedia.com.au/2010/12/12/using-r-and-bbedit/#comments</comments>
		<pubDate>Sun, 12 Dec 2010 13:53:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.ugmedia.com.au/?p=46</guid>
		<description><![CDATA[The statistical programming environment R is very powerful. The Mac text editor BBEdit is also very powerful. Together they are the ultimate combination. Luckily, with minimal effort you can make them very happy bedfellows. Here are two ways of integrating R with BBEdit. Syntax colouring Download the R syntax colouring file and move it to [...]]]></description>
			<content:encoded><![CDATA[<p>The statistical programming environment R is very powerful. The Mac text editor BBEdit is also very powerful. Together they are the ultimate combination. Luckily, with minimal effort you can make them very happy bedfellows. Here are two ways of integrating R with BBEdit.</p>
<p><strong>Syntax colouring</strong><br />
Download the <a href="http://www.smalltime.com/gene/R.plist">R syntax colouring file</a> and move it to your &#8220;~/Library/Application Support/BBEdit/Language Modules/&#8221; folder.</p>
<p><strong>Running code from within BBEdit</strong><br />
Two AppleScripts based on a <a href="http://www.mail-archive.com/r-sig-mac@stat.math.ethz.ch/msg03522.html">post on an R mailing list</a>.  The first script will run the current selection (or line if there is no selection) in R. The second script will run the entire file in R. Save these scripts into your &#8220;~/Library/Application Support/BBEdit/Scripts/&#8221; folder. You can then go to Window -> Palettes -> Scripts and assign some shortcut keys to these scripts. I use Command-R to run the file, and Command-Option-R to run the line.</p>
<p>Open up Applescript Editor and paste these chunks of code into two separate files.</p>
<p>Save this file as &#8216;Run file in R&#8217;:</p>
<pre>
tell application "BBEdit"
   set theFile to (file of document of front window as string)
   set theFilePath to POSIX path of theFile
end tell

tell application "R"
   if theFile is "missing value" then
      beep
      cmd "print(" &#038; quote &#038; "Error: BBEdit file is not saved" &#038; quote &#038; ")"
   else
      cmd "source(" &#038; quote &#038; theFilePath &#038; quote &#038; ")"
   end if
end tell
</pre>
<p>Save this file as &#8216;Run line in R&#8217;:</p>
<pre>
tell application "BBEdit"
    set theText to (selection of front window as string)
    if (theText) is "" then
        set theText to line (get startLine of selection) of front window as string
    end if
end tell

tell application "R"
    cmd theText
end tell
</pre>
<p>Jonathan Marc Bearak has some similar tips on his <a href="https://files.nyu.edu/jmb736/public/projects/R.html">R &#038; BBEdit integration page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ugmedia.com.au/2010/12/12/using-r-and-bbedit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

