<?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>Mental Masturbation, Musings, and Methods &#187; AppleScript</title>
	<atom:link href="http://blog.alexbeutel.com/category/programming/applescript-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.alexbeutel.com</link>
	<description>The Mind of Alex Beutel</description>
	<lastBuildDate>Mon, 02 Aug 2010 06:20:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Rsync Backup and Batch Printing</title>
		<link>http://blog.alexbeutel.com/22/rsync-backup-and-batch-printing/</link>
		<comments>http://blog.alexbeutel.com/22/rsync-backup-and-batch-printing/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 18:24:40 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Duke]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.ambmediadesign.com/?p=22</guid>
		<description><![CDATA[So I haven't posted in months and have a short break between classes so I wanted to post some scripts that I wrote this year and have been particularly useful.  These are both specific to Duke's campus, but could easily be extended to other situations.  The first is backup.  In the past few months I [...]]]></description>
			<content:encoded><![CDATA[<p>So I haven't posted in months and have a short break between classes so I wanted to post some scripts that I wrote this year and have been particularly useful.  These are both specific to Duke's campus, but could easily be extended to other situations.  The first is backup.  In the past few months I had my external hard drive in addition to numerous friend's entire computer crash.  My dad, just before I left, bought a year long subscription to Mozy, so, nervous about losing all of my data, I thought I'd look into it.  On their very informative site, they give alternatives to their product.  Most of the solutions are rediculous like burn 30 DVDs of all your data each month, but one happens to be a great idea: "Run a cron job of rsync, gzip and mcrypt piped over ssh to your friend's server over his DSL line."  I am assuming they were hoping the use of as many acronyms as possible and funny sounding words would deter people from actually reading the statement, but it turns out the basic concept as very easy to implement.  Considering here at Duke each student has 5 gig of server space and I have a server in my room, and its all in-network so its very fast, a simple ssh into the server and running rsync is actually really easy.  I have multiple different rsyncs set up as bash files, such as one for just my schoolwork so I can quickly and frequently back this up and one for my whole harddrive which takes slightly longer.  I also recently set this up for my not-quite as technical friend and gave her a small AppleScript application to run to do the rsync after I set it up.  The only real set up is go onto the server, create a folder (in a private directory) and thats it.  Then configure the script below appropriately and your done.  Here is the script:</p>
<div class="igBar"><span id="lapplescript-3"><a href="#" onclick="javascript:showPlainTxt('applescript-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">APPLESCRIPT:</span>
<div id="applescript-3">
<div class="applescript" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #b1b100;">tell</span> application <span style="color: #ff0000;">&quot;Terminal&quot;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; activate</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; do <span style="color: #b1b100;">script</span> <span style="color: #b1b100;">with</span> command <span style="color: #ff0000;">&quot;rsync -avvvz --delete-after -e ssh /Users/{name}/directoryToBackup/ username@login1.oit.duke.edu:~/Private/backupFolder&quot;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #b1b100;">end</span> <span style="color: #b1b100;">tell</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
Above we see to simply first reference the name of the folder on your local machine to back up and then username@server address colon folder on server to back up to.  And that's it.  Simple and very effective.  Thanks Mozy.</p>
<p>The second recent hacked together script I made was a basic way of batch printing.  Duke has a system called E-Print, which runs basically by Line Printer Daemon (LPD) to a specific address.  Any network printer set up like this.  The other key requirement is that I have set my short name on my Mac to my NetID because this short name is the username that is sent through to LPD.  If you have this, I create a simple AppleScript application that takes either all selected items or all files in a folder and prints them separately and in duplex with the lpr command.  This script is below.</p>
<div class="igBar"><span id="lapplescript-4"><a href="#" onclick="javascript:showPlainTxt('applescript-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">APPLESCRIPT:</span>
<div id="applescript-4">
<div class="applescript" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">-- script was clicked</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #b1b100;">on</span> <span style="color: #000066;">run</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">tell</span> application <span style="color: #ff0000;">&quot;Finder&quot;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> selection <span style="color: #b1b100;">is</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">then</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">set</span> selection <span style="color: #b1b100;">to</span> files <span style="color: #b1b100;">in</span> folder <span style="color: #b1b100;">of</span> <span style="color: #000000; font-weight: bold;">the</span> <span style="color: #000000; font-weight: bold;">front</span> window</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">end</span> <span style="color: #b1b100;">if</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">set</span> finderSelection <span style="color: #b1b100;">to</span> selection <span style="color: #000066;">as</span> alias list</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">end</span> <span style="color: #b1b100;">tell</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000066;">print</span> <span style="color: #66cc66;">&#123;</span>finderSelection<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #b1b100;">end</span> <span style="color: #000066;">run</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">-- script was drag-and-dropped onto</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #b1b100;">on</span> <span style="color: #000066;">open</span> <span style="color: #66cc66;">&#40;</span>theList<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000066;">print</span> <span style="color: #66cc66;">&#40;</span>theList<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #b1b100;">end</span> <span style="color: #000066;">open</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">-- print</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #b1b100;">on</span> <span style="color: #000066;">print</span> <span style="color: #66cc66;">&#123;</span>listOfAliases<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">repeat</span> <span style="color: #b1b100;">with</span> currentFile <span style="color: #b1b100;">in</span> listOfAliases</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">set</span> currentFileName <span style="color: #b1b100;">to</span> POSIX path <span style="color: #b1b100;">of</span> currentFile</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; do shell <span style="color: #b1b100;">script</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;lpr -o sides=two-sided-long-edge '&quot;</span> <span style="color: #66cc66;">&amp;</span> currentFileName <span style="color: #66cc66;">&amp;</span> <span style="color: #ff0000;">&quot;'&quot;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">end</span> <span style="color: #b1b100;">repeat</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #b1b100;">end</span> <span style="color: #000066;">print</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
Or you can download the application <a href='http://ambmediadesign.com/PrintAll.app' title='PrintAll application'>here</a>.  Place this inside your applications directory, and then in Leopard you can drag it to the toolbar of Finder.  I believe you also need to make sure you have the LPD printer set to your default printer. The, you can always easily batch print.</p>
<p>Note: You can also in command line use lp but this will combine all of the documents printed into one item on the print queue, which has its disadvantages in the Duke e-Print system.  Also, I need to thank Henrik Nyh whose <a href='http://henrik.nyh.se/2007/10/open-in-textmate-from-leopard-finder'>"Open in Textmate"</a> script I use and worked off of for this.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexbeutel.com/22/rsync-backup-and-batch-printing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running Multiple versions of Firefox</title>
		<link>http://blog.alexbeutel.com/12/running-multiple-versions-of-firefox/</link>
		<comments>http://blog.alexbeutel.com/12/running-multiple-versions-of-firefox/#comments</comments>
		<pubDate>Mon, 19 May 2008 01:46:47 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Quicksilver]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://blog.ambmediadesign.com/12/running-multiple-versions-of-firefox/</guid>
		<description><![CDATA[So, in my recent frustration of both Facebook Chat suddenly not working on Firefox 3 RC1 and also many of my developer add-ons for Firefox not working in the new Firefox, I decided to try to run both Firefox 2 and 3 simultaneously.  This can of course be done with the two separate profiles and [...]]]></description>
			<content:encoded><![CDATA[<p>So, in my recent frustration of both Facebook Chat suddenly not working on Firefox 3 RC1 and also many of my developer add-ons for Firefox not working in the new Firefox, I decided to try to run both Firefox 2 and 3 simultaneously.  This can of course be done with the two separate profiles and the command -no-remote as outlined in <a href="http://blog.codefront.net/2007/08/20/how-to-have-firefox-3-and-firefox-2-running-at-the-same-time/" target="_blank">http://blog.codefront.net/2007/08/20/how-to-have-firefox-3-and-firefox-2-running-at-the-same-time </a>  After this I wanted to turn this into an AppleScript to run from Quicksilver.  Using the command do shell script allows for the Terminal command to be run.  However, running the basic command as outline in the link above causes ScriptEditor or Quicksilver (whichever is running the script) to hang.  To fix this, we need to run the application in the background.  The normal way of doing this in Unix is to add an ampersand to the end of the command.  However, this is not enough for AppleScipt.  Finally, after looking at <a href="http://developer.apple.com/technotes/tn2002/tn2065.html" target="_blank">this</a> page I saw that the proper full script would be:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p12code2'); return false;">View Code</a> APPLESCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p122"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p12code2"><pre class="applescript" style="font-family:monospace;"><span style="color: #0066ff;">do shell script</span> <span style="color: #000000;">&#40;</span><span style="color: #009900;">&quot;/Applications/Firefox.app/Contents/MacOS/firefox -P <span style="color: #000000; font-weight: bold;">\&quot;</span>Default User<span style="color: #000000; font-weight: bold;">\&quot;</span> -no-remote &amp;&gt; /dev/null &amp;&quot;</span><span style="color: #000000;">&#41;</span></pre></td></tr></table></div>

<p>Of course you can make two scripts for the two different applications and two different profiles as outline in the above link.  However, make sure to add the "&amp;&gt; /dev/null &amp;" to the end so as to write the PID to a null file /dev/null and then to keep the process running in the background.  I hope this helps, and, as always, let me know if you have any tips.  Thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexbeutel.com/12/running-multiple-versions-of-firefox/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>iChat, Adium, and Quicksilver</title>
		<link>http://blog.alexbeutel.com/11/ichat-adium-and-quicksilver/</link>
		<comments>http://blog.alexbeutel.com/11/ichat-adium-and-quicksilver/#comments</comments>
		<pubDate>Mon, 12 May 2008 17:38:36 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Quicksilver]]></category>

		<guid isPermaLink="false">http://blog.ambmediadesign.com/11/ichat-adium-and-quicksilver/</guid>
		<description><![CDATA[So recently Adium has been annoying me because it seems to not pay attention to if I am actually connected to the internet.  It says I'm online when I lose my connection and as a result I lose full connections.  As a result I have been switching back and forth and sometimes using both iChat [...]]]></description>
			<content:encoded><![CDATA[<p>So recently Adium has been annoying me because it seems to not pay attention to if I am actually connected to the internet.  It says I'm online when I lose my connection and as a result I lose full connections.  As a result I have been switching back and forth and sometimes using both iChat and Adium.  As a result, I had to modify my AppleScript from the previous post.  I also this time used some code from <a href="http://codesnippets.joyent.com/posts/show/1124" target="_blank">here</a>.  Anyway the update checks to see if I am using either Adium or iChat, and does the appropriate action for each. The updated Away file is as follows:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p11code5'); return false;">View Code</a> APPLESCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p115"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code" id="p11code5"><pre class="applescript" style="font-family:monospace;">using terms <span style="color: #ff0033; font-weight: bold;">from</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Quicksilver&quot;</span>
	<span style="color: #ff0033; font-weight: bold;">on</span> process <span style="color: #0066ff;">text</span> ThisClipping
		<span style="color: #ff0033; font-weight: bold;">if</span> appIsRunning<span style="color: #000000;">&#40;</span><span style="color: #009900;">&quot;Adium&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
			<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Adium&quot;</span>
				<span style="color: #ff0033; font-weight: bold;">set</span> <span style="color: #ff0033;">the</span> status type <span style="color: #ff0033; font-weight: bold;">of</span> <span style="color: #ff0033;">the</span> <span style="color: #ff0033;">first</span> account <span style="color: #ff0033; font-weight: bold;">to</span> away
				<span style="color: #ff0033; font-weight: bold;">set</span> <span style="color: #ff0033;">the</span> status message <span style="color: #ff0033; font-weight: bold;">of</span> <span style="color: #ff0033;">the</span> <span style="color: #ff0033;">first</span> account <span style="color: #ff0033; font-weight: bold;">to</span> ThisClipping
			<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
		<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
		<span style="color: #ff0033; font-weight: bold;">if</span> appIsRunning<span style="color: #000000;">&#40;</span><span style="color: #009900;">&quot;iChat&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
			<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;iChat&quot;</span>
				<span style="color: #ff0033; font-weight: bold;">set</span> status message <span style="color: #ff0033; font-weight: bold;">to</span> ThisClipping
				<span style="color: #ff0033; font-weight: bold;">set</span> status <span style="color: #ff0033; font-weight: bold;">to</span> away
			<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
		<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
&nbsp;
	<span style="color: #ff0033; font-weight: bold;">end</span> process <span style="color: #0066ff;">text</span>
<span style="color: #ff0033; font-weight: bold;">end</span> using terms <span style="color: #ff0033; font-weight: bold;">from</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> appIsRunning<span style="color: #000000;">&#40;</span>appName<span style="color: #000000;">&#41;</span>
	<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;System Events&quot;</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">of</span> processes<span style="color: #000000;">&#41;</span> <span style="color: #ff0033;">contains</span> appName
<span style="color: #ff0033; font-weight: bold;">end</span> appIsRunning</pre></td></tr></table></div>

<p>And the updated Available file is:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p11code6'); return false;">View Code</a> APPLESCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p116"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code" id="p11code6"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">if</span> appIsRunning<span style="color: #000000;">&#40;</span><span style="color: #009900;">&quot;iChat&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
	<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;iChat&quot;</span>
		<span style="color: #ff0033; font-weight: bold;">set</span> status <span style="color: #ff0033; font-weight: bold;">to</span> available
		<span style="color: #ff0033; font-weight: bold;">set</span> status message <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;&quot;</span>
	<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
<span style="color: #ff0033; font-weight: bold;">if</span> appIsRunning<span style="color: #000000;">&#40;</span><span style="color: #009900;">&quot;Adium&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
	<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Adium&quot;</span> <span style="color: #ff0033; font-weight: bold;">to</span> go available
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> appIsRunning<span style="color: #000000;">&#40;</span>appName<span style="color: #000000;">&#41;</span>
	<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;System Events&quot;</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">of</span> processes<span style="color: #000000;">&#41;</span> <span style="color: #ff0033;">contains</span> appName
<span style="color: #ff0033; font-weight: bold;">end</span> appIsRunning</pre></td></tr></table></div>

<p>Enjoy and please leave comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexbeutel.com/11/ichat-adium-and-quicksilver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adium and Quicksilver</title>
		<link>http://blog.alexbeutel.com/10/adium-and-quicksilver/</link>
		<comments>http://blog.alexbeutel.com/10/adium-and-quicksilver/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 01:01:09 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Adium]]></category>
		<category><![CDATA[Quicksilver]]></category>

		<guid isPermaLink="false">http://blog.ambmediadesign.com/10/adium-and-quicksilver/</guid>
		<description><![CDATA[I searched around yesterday for a plugin or script to use Quicksilver to set my Adium status, and while there were numerous results, all were outdated and did not work with newer versions of both pieces of software. So I decided to edit some of the ones I had found online. The original code that [...]]]></description>
			<content:encoded><![CDATA[<p>I searched around yesterday for a plugin or script to use Quicksilver to set my Adium status, and while there were numerous results, all were outdated and did not work with newer versions of both pieces of software.  So I decided to edit some of the ones I had found online.  The original code that I was working off of came from <a href="http://chrismetcalf.net/blog/archives/2006/07/25/quicksilveradium-away-message-hack/" target="_blank">here</a></p>
<p>As you can read in the directions on that page, first you must open ScriptEditor and copy in the following code:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p10code9'); return false;">View Code</a> APPLESCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p109"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p10code9"><pre class="applescript" style="font-family:monospace;">using terms <span style="color: #ff0033; font-weight: bold;">from</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Quicksilver&quot;</span>
	<span style="color: #ff0033; font-weight: bold;">on</span> process <span style="color: #0066ff;">text</span> ThisClipping
&nbsp;
		<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Adium&quot;</span>
			<span style="color: #ff0033; font-weight: bold;">set</span> <span style="color: #ff0033;">the</span> status type <span style="color: #ff0033; font-weight: bold;">of</span> <span style="color: #ff0033;">the</span> <span style="color: #ff0033;">first</span> account <span style="color: #ff0033; font-weight: bold;">to</span> away
			<span style="color: #ff0033; font-weight: bold;">set</span> <span style="color: #ff0033;">the</span> status message <span style="color: #ff0033; font-weight: bold;">of</span> <span style="color: #ff0033;">the</span> <span style="color: #ff0033;">first</span> account <span style="color: #ff0033; font-weight: bold;">to</span> ThisClipping
		<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
&nbsp;
	<span style="color: #ff0033; font-weight: bold;">end</span> process <span style="color: #0066ff;">text</span>
<span style="color: #ff0033; font-weight: bold;">end</span> using terms <span style="color: #ff0033; font-weight: bold;">from</span></pre></td></tr></table></div>

<p>This code will set your away message and the following code will set you back to available.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p10code10'); return false;">View Code</a> APPLESCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1010"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p10code10"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Adium&quot;</span> <span style="color: #ff0033; font-weight: bold;">to</span> go available</pre></td></tr></table></div>

<p>With each script as an individual file, save the file to ~/Library/Application Support/Quicksilver/Actions/</p>
<p>After each script is saved, restart Quicksilver and enter in the name of the script (whatever you saved it as) and press enter.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexbeutel.com/10/adium-and-quicksilver/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
