<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>TheCodingMonkeys Blog: Running a SubEthaEdit "server"</title>
    <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Running a SubEthaEdit &amp;quot;server&amp;quot;</title>
      <description>&lt;p&gt;If you'd like to run SubEthaEdit on a server you might be interested in a few tricks we are using to run &lt;a href="see://codingmonkeys.de"&gt;see://codingmonkeys.de&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;First of all, codingmonkeys.de is not hosted on Mac OS X, but BSD. To forward SubEthaEdit traffic to a Mac OS X machine with Internet connection, we use redir. An example setup for &lt;a href="http://sammy.net/~sammy/hacks/"&gt;redir&lt;/a&gt; would be "&lt;code&gt;redir --lport 6942 --caddr &amp;lt;remoteipaddress&amp;gt; --cport 6942 -nredir --syslog&lt;/code&gt;"&lt;/p&gt;

&lt;p&gt;Secondly we automate the sharing of documents on the server with an AppleScript that is called as a LoginItem. It takes care of opening the documents we'd like to be hosted, setting the access control to read/write and sharing them.&lt;/p&gt;

&lt;p&gt;&lt;div style="text-align:left;color:#408000; background-color:#ffffff; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; "&gt;&lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;tell&lt;/span&gt;&lt;/strong&gt; &lt;span style="color:#0b0bff;"&gt;application&lt;/span&gt; &lt;span style="color:#000000;"&gt;&amp;quot;SubEthaEdit&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;activate&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0b0bff;"&gt;open&lt;/span&gt; &lt;span style="color:#000000;"&gt;&amp;quot;:Users:subethaserver:Documents:SubEthaEdit Documents:Chat.txt&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0b0bff;"&gt;open&lt;/span&gt; &lt;span style="color:#000000;"&gt;&amp;quot;:Users:subethaserver:Documents:SubEthaEdit Documents:conference.notes&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0b0bff;"&gt;open&lt;/span&gt; &lt;span style="color:#000000;"&gt;&amp;quot;:Users:subethaserver:Documents:SubEthaEdit Documents:index.html&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;tell&lt;/span&gt;&lt;/strong&gt; documents&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;set&lt;/span&gt;&lt;/strong&gt; access control &lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;to&lt;/span&gt;&lt;/strong&gt; read write&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;set&lt;/span&gt;&lt;/strong&gt; announced &lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;to&lt;/span&gt;&lt;/strong&gt; &lt;span style="color:#0b0bff;"&gt;true&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;end&lt;/span&gt;&lt;/strong&gt; &lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;tell&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;end&lt;/span&gt;&lt;/strong&gt; &lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;tell&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;If you also would like to auto-save documents on the server e.g. every 5 minutes, you could use another AppleScript:&lt;/p&gt;

&lt;p&gt;&lt;div style="text-align:left;color:#408000; background-color:#ffffff; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; "&gt;&lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;tell&lt;/span&gt;&lt;/strong&gt; &lt;span style="color:#0b0bff;"&gt;application&lt;/span&gt; &lt;span style="color:#000000;"&gt;&amp;quot;SubEthaEdit&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;repeat&lt;/span&gt;&lt;/strong&gt; &lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;until&lt;/span&gt;&lt;/strong&gt; &lt;span style="color:#0b0bff;"&gt;false&lt;/span&gt; &lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;is&lt;/span&gt;&lt;/strong&gt; &lt;span style="color:#0b0bff;"&gt;true&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:#0b0bff;"&gt;save&lt;/span&gt; documents&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delay &lt;span style="color:#000000;"&gt;5&lt;/span&gt; &lt;span style="color:#000000;"&gt;*&lt;/span&gt; &lt;span style="color:#000000;"&gt;60&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;end&lt;/span&gt;&lt;/strong&gt; &lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;repeat&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;end&lt;/span&gt;&lt;/strong&gt; &lt;strong&gt;&lt;span style="color:#0b0bff;"&gt;tell&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/p&gt;

</description>
      <pubDate>Mon, 03 Apr 2006 12:10:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:3ecc50fb-5486-43a3-8186-b44612fbd44b</guid>
      <author>map</author>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server</link>
      <category>SubEthaEdit</category>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by A line skirt</title>
      <description>&lt;p&gt;Personally, I don&#8217;t use the GWT syntax, but I definitely grok the rationale behind expressing tests in this manner.&lt;/p&gt;</description>
      <pubDate>Mon, 16 Aug 2010 23:54:21 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:6cf6c954-0c12-4b3e-88d5-0ac01668e572</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-1100</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by ink cartridges</title>
      <description>&lt;p&gt;I must admit that today is my first time I visit here. However, I have found so many interesting thing in your blog and I really love that.&lt;/p&gt;</description>
      <pubDate>Mon, 16 Aug 2010 03:23:32 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:c9c72dd0-642d-490d-bae0-fd7f95528774</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-1095</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by Mosquito repellent plants</title>
      <description>&lt;p&gt;You have to replace ideltime with the value in seconds that you want to wait until your handler gets called again. So you would exit the idle with a return 5*60 to have the same effect as the loop above.&lt;/p&gt;</description>
      <pubDate>Wed, 11 Aug 2010 13:56:09 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:040e2339-4d93-41b7-b4c8-810e39d6ecc9</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-1080</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by elina smith</title>
      <description>&lt;p&gt;how can i put " created by subethaedit" button on my website?&lt;/p&gt;</description>
      <pubDate>Thu, 22 Jul 2010 16:30:28 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:fc00f1ae-2351-453c-8e2d-6d06cb63fa05</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-1051</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by andrew thomas</title>
      <description>&lt;p&gt;a good explanation about the warning regarding mixed line endings. It is very much useful in preventing subversion difficulties that arise due to mixed line ending. Though sometime it is quiet annoying but at the same time very informative in building application. Nice work. Thanks.
&lt;a href="http://rsssaturn.com
"&gt;andrewthomas&lt;/a&gt; &lt;/p&gt;</description>
      <pubDate>Wed, 21 Jul 2010 19:16:56 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:d76427b3-a89b-460e-8bd2-96624b1a9778</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-1044</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by Antony</title>
      <description>&lt;p&gt;Great guide! I will try it. I hope it is not going to eat my CPU. I have a linux based VPS hosing.&lt;/p&gt;</description>
      <pubDate>Fri, 02 Jul 2010 15:29:51 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:230aba50-5ce3-4238-b6d7-773d15643eb7</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-1015</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by fabulous</title>
      <description>&lt;p&gt;This is the most comprehensive guide I have come across. Thanks for sharing this with us&lt;/p&gt;</description>
      <pubDate>Tue, 01 Jun 2010 12:03:09 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:292839a4-54b2-420c-b452-527b99b6b311</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-927</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by fabulous</title>
      <description>&lt;p&gt;This is the most comprehensive guide I have come across. Thanks for sharing this with us&lt;/p&gt;</description>
      <pubDate>Tue, 01 Jun 2010 12:03:05 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:a5efcf9a-996d-4f13-8186-32e8f9cf431b</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-926</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by Low Cost Domains</title>
      <description>&lt;p&gt;Great blog post. It&#8217;s useful information.&lt;/p&gt;</description>
      <pubDate>Tue, 11 May 2010 07:57:03 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:a1ff89d9-abff-45c8-804b-0d4ef322afb7</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-872</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by dom</title>
      <description>&lt;p&gt;You have to replace ideltime with the value in seconds that you want to wait until your handler gets called again. So you would exit the idle with a return 5*60 to have the same effect as the loop above.&lt;/p&gt;

&lt;p&gt;"save documents" returns a list of missing values that is as long as the number of documents. This isn't particularly useful (you could take the length as an indicator on how many documents have been saved) but not a problem either. If "save documents" is the last statement in your script then the Script Editor reports its return value as result of the script. So This isn't an error.&lt;/p&gt;</description>
      <pubDate>Mon, 29 May 2006 12:59:39 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:95aa342d-a8ff-46f6-b695-91dae627547c</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-47</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by Chris Bracey</title>
      <description>When I use the original Save script, after save every document the Event Log says {missing value, missing value...} (one for every open see document)


Sorry, I'm new to AppleScript, so I'm not sure how significant the error is - the changes appear to be saving for at least the first few times. But definitely after the scripts been running for a few hours the saves don't seem to be happening any more.


I'm uncomfortable about the processor load with the "Repeat until true equals false" bit, so thought I'd try "on idle"


If I say:
on idle
	tell application "SubEthaEdit"
		save every document
	end tell
end idle
nothing seems to happen


If I use Armin's script (Thanks, Armin!), the top part works fine (with the addition of telling Finder "set visible of process "SubEthaEdit" to false"), but it chokes on "return idletime" (idletime not defined), and if I take out the "return idletime" lines, it never goes into the on idle part of the script...


I would really appreciate if someone could point out what I'm missing here!

thanks
Chris</description>
      <pubDate>Mon, 29 May 2006 07:27:58 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:9aa968ff-abb4-4236-b62e-99f5071dddb1</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-46</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by Dave</title>
      <description> repeat until false is true

Love it!</description>
      <pubDate>Tue, 25 Apr 2006 23:20:09 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:283b56f9-8ce3-4022-a978-34dc37645850</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-23</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by Armin</title>
      <description>formatting didn't make it in to the previous comment: apologies

&lt;pre&gt;on run
	tell application "Finder"
		set docFolder to path to documents folder from user domain
		set seeFolder to folder "SubEthaEdit Server Documents" of docFolder
		set thelist to every file of seeFolder
		repeat with x in thelist
			tell application "SubEthaEdit"
				open x
				tell document 1
					set access control to read write
					set announced to true
				end tell
			end tell
		end repeat
	end tell
	
	return idletime
end run

on idle
	tell application "SubEthaEdit"
		save every document
	end tell
	
	return idletime
end idle&lt;/pre&gt;

Save as application, be sure to check "Stay Open" and put the script applet in the login items.

</description>
      <pubDate>Tue, 11 Apr 2006 00:34:58 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:3c269141-36bb-48a5-a289-7746b51fd6ec</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-19</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by Armin</title>
      <description>I extended the script a little:

on run
	tell application "Finder"
		set docFolder to path to documents folder from user domain
		set seeFolder to folder "SubEthaEdit Server Documents" of docFolder
		set thelist to every file of seeFolder
		repeat with x in thelist
			tell application "SubEthaEdit"
				open x
				tell document 1
					set access control to read write
					set announced to true
				end tell
			end tell
		end repeat
	end tell
	
	return idletime
end run

on idle
	tell application "SubEthaEdit"
		save every document
	end tell
	
	return idletime
end idle

Save as application, be sure to check "Stay Open" and put the script applet in the login items.

Then create the folder "SubEthaEdit Server Documents" in your documents folder, put something in there.

Share and enjoy!</description>
      <pubDate>Tue, 11 Apr 2006 00:32:53 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:6918b65e-e65a-4897-9e57-a1f14d03d8c2</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-18</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by Stefan Huy</title>
      <description>:)</description>
      <pubDate>Fri, 07 Apr 2006 16:21:28 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:042af781-61b9-4015-9f49-0fda7bc114ff</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-17</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by johnsonwax</title>
      <description>Definitely do on idle - much better on CPU load.</description>
      <pubDate>Wed, 05 Apr 2006 03:10:02 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:132b1d44-d2f0-4222-a339-5a2ff24fd96e</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-16</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by jonct</title>
      <description>Or simply: on idle, tell application "SubEthaEdit" to save documents, end idle.</description>
      <pubDate>Tue, 04 Apr 2006 09:10:07 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:7e5f0bf5-5d27-4e12-9bc4-e6ba543ad7d1</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-15</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by pmcm</title>
      <description>I think just "repeat" is nicer than: "repeat until false is true" ...just a though.</description>
      <pubDate>Mon, 03 Apr 2006 17:41:10 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:53023bd2-0074-4a54-aa80-17ddceaea994</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-13</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by map</title>
      <description>I'd prefer not to talk about plans, but we of course have thought about a "real" SubEthaEdit server process.</description>
      <pubDate>Mon, 03 Apr 2006 15:15:02 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:28613043-4890-4fa6-8734-5cef32608c0d</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-12</link>
    </item>
    <item>
      <title>"Running a SubEthaEdit "server"" by David Steinbrunner</title>
      <description>Are there any plans to have an actual server product?

I have always thought it would be nice to be able to point SubEthaEdit at a CVS/SVN repository and just have the whole thing served with directory structures and all kept in tact.  This would make users find shared documents though nav services rather than than just going through a simple list but I think that the abstraction needed for the server feature would be a great value add for developers working on projects with a great deal of abstraction themselves (which require working with many file at different times in different places in the repository).</description>
      <pubDate>Mon, 03 Apr 2006 14:38:03 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:91cd1189-b864-4b47-b43f-99879062c5b0</guid>
      <link>http://codingmonkeys.de/blog/articles/2006/04/03/running-a-subethaedit-server#comment-11</link>
    </item>
  </channel>
</rss>
