<?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>GFMorris.org &#187; Geof F. Morris</title>
	<atom:link href="http://gfmorris.org/archives/author/geof-f-morris/feed/" rel="self" type="application/rss+xml" />
	<link>http://gfmorris.org</link>
	<description>Smart Guy, Dumb Code</description>
	<lastBuildDate>Mon, 31 Oct 2011 22:58:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Lion-Ready Junk Mail Reporting Scripts</title>
		<link>http://gfmorris.org/archives/2011/07/24/lion-ready-junk-mail-reporting-scripts/</link>
		<comments>http://gfmorris.org/archives/2011/07/24/lion-ready-junk-mail-reporting-scripts/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 16:36:28 +0000</pubDate>
		<dc:creator>Geof F. Morris</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://gfmorris.org/?p=70</guid>
		<description><![CDATA[After trying for a day to fix my Lion-broken scripts, I finally gave up and asked folks at Apple&#8217;s discussion forum about my problem, and the very first response by Pierre L. nailed it: Try replacing this one line: set &#8230; <a href="http://gfmorris.org/archives/2011/07/24/lion-ready-junk-mail-reporting-scripts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After trying for a day to fix <a href="http://gfmorris.org/archives/2011/07/20/lion-mail-broke-my-junk-mail-reporting-apple-scripts/">my Lion-broken scripts</a>, <a href="https://discussions.apple.com/message/15716461#15716461">I finally gave up and asked folks at Apple&#8217;s discussion forum about my problem</a>, and <a href="https://discussions.apple.com/message/15720396#15720396">the very first response by Pierre L. nailed it</a>:</p>
<blockquote><p>Try replacing this one line:</p>
<p>    set content to thisMessage&#8217;s source</p>
<p>with these two lines:</p>
<p>    set theSource to thisMessage&#8217;s source<br />
    set content to theSource</p></blockquote>
<p>That worked like a champ.</p>
<p>Updated scripts are available: <a href="http://gfmorris.org/wordpress/wp-content/uploads/2011/10/spam_uce_gov.scpt">spam_uce_gov.scpt</a> and <a href="http://gfmorris.org/wordpress/wp-content/uploads/2011/10/spoof_paypal_com.scpt">spam_paypal_com.scpt</a>.  As always, these are provided for free and are unsupported, although I&#8217;ll try to help if I can.</p>
<p><strong>[Update, 31 Oct 2011]:</strong> These scripts had an issue with background sending, as the accumulated emails would clog up.  <a href="https://discussions.apple.com/message/16583872#16583872">I got a great suggestion for a fix on the AppleScript forums at apple.com</a>, and now things seem to be working.  I&#8217;ve replaced the scripts above with the improved copies.</p>
]]></content:encoded>
			<wfw:commentRss>http://gfmorris.org/archives/2011/07/24/lion-ready-junk-mail-reporting-scripts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lion Mail Broke My Junk Mail-Reporting Apple Scripts</title>
		<link>http://gfmorris.org/archives/2011/07/20/lion-mail-broke-my-junk-mail-reporting-apple-scripts/</link>
		<comments>http://gfmorris.org/archives/2011/07/20/lion-mail-broke-my-junk-mail-reporting-apple-scripts/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 18:51:33 +0000</pubDate>
		<dc:creator>Geof F. Morris</dc:creator>
				<category><![CDATA[AppleScript]]></category>

		<guid isPermaLink="false">http://gfmorris.org/?p=66</guid>
		<description><![CDATA[My scripts for handling junk mail in OS X Mail do not currently work in the just-released Mail bundled in Mac OS X Lion (10.7).  I&#8217;m looking into what the new dictionary is to see how best to modify them &#8230; <a href="http://gfmorris.org/archives/2011/07/20/lion-mail-broke-my-junk-mail-reporting-apple-scripts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://gfmorris.org/archives/2010/06/06/update-to-my-spam-reporting-applescripts/">My scripts for handling junk mail in OS X</a> Mail do not currently work in the just-released Mail bundled in Mac OS X Lion (10.7).  I&#8217;m looking into what the new dictionary is to see how best to modify them for work going forward.  Thanks for your patience.</p>
]]></content:encoded>
			<wfw:commentRss>http://gfmorris.org/archives/2011/07/20/lion-mail-broke-my-junk-mail-reporting-apple-scripts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Modifying My On-the-Phone AppleScript &#8211; iTunes Status</title>
		<link>http://gfmorris.org/archives/2010/09/07/modifying-my-on-the-phone-applescript-itunes-status/</link>
		<comments>http://gfmorris.org/archives/2010/09/07/modifying-my-on-the-phone-applescript-itunes-status/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 22:15:01 +0000</pubDate>
		<dc:creator>Geof F. Morris</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Adium]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[system volume]]></category>

		<guid isPermaLink="false">http://gfmorris.org/?p=62</guid>
		<description><![CDATA[I&#8217;ve made a minor modification to my previous iteration of my on-the-phone AppleScript. Here&#8217;s the change: tell application "iTunes" if player state is playing or player state is paused then playpause end tell In the previous iteration, running on-phone.scpt would &#8230; <a href="http://gfmorris.org/archives/2010/09/07/modifying-my-on-the-phone-applescript-itunes-status/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made a minor modification to my previous iteration of my on-the-phone AppleScript.  Here&#8217;s the change:</p>
<pre>
tell application "iTunes"
	if player state is playing or player state is paused then playpause
end tell
</pre>
<p>In the previous iteration, running on-phone.scpt would start iTunes to playing if it was invoked while iTunes stopped, and then pause iTunes when re-invoked.  That doesn&#8217;t make sense: if iTunes is stopped, it&#8217;s stopped for a reason, and this script shouldn&#8217;t change that fact.  For me, iTunes is stopped when I&#8217;m using AppleScript to invoke <a href="http://www.griffintechnology.com/products/radioshark">RadioSHARK</a> or <a href="http://www.rogueamoeba.com/pulsar/">Pulsar</a> to listen to the radio.</p>
<p>You can <a href="http://gfmorris.org/wordpress/wp-content/uploads/2010/09/on-phone.scpt">download the updated on-phone script</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gfmorris.org/archives/2010/09/07/modifying-my-on-the-phone-applescript-itunes-status/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running WordPress 3.0</title>
		<link>http://gfmorris.org/archives/2010/06/17/running-wordpress-3-0/</link>
		<comments>http://gfmorris.org/archives/2010/06/17/running-wordpress-3-0/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 21:17:51 +0000</pubDate>
		<dc:creator>Geof F. Morris</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://gfmorris.org/?p=42</guid>
		<description><![CDATA[I&#8217;ve upgraded this site to WordPress 3.0 as a pathfinder for a number of reasons, one of them being that I have a professional interest in doing so. This site is always my bleeding edge for WordPress upgrades&#8212;if it doesn&#8217;t &#8230; <a href="http://gfmorris.org/archives/2010/06/17/running-wordpress-3-0/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve upgraded this site to WordPress 3.0 as a pathfinder for a number of reasons, one of them being that I have a professional interest in doing so.  This site is always my bleeding edge for WordPress upgrades&#8212;if it doesn&#8217;t break here, it typically won&#8217;t break elsewhere&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://gfmorris.org/archives/2010/06/17/running-wordpress-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing an On-the-Phone AppleScript</title>
		<link>http://gfmorris.org/archives/2010/06/16/developing-an-on-the-phone-applescript/</link>
		<comments>http://gfmorris.org/archives/2010/06/16/developing-an-on-the-phone-applescript/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 19:12:48 +0000</pubDate>
		<dc:creator>Geof F. Morris</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Adium]]></category>
		<category><![CDATA[system volume]]></category>

		<guid isPermaLink="false">http://gfmorris.org/?p=39</guid>
		<description><![CDATA[I&#8217;m now working from home, but I can&#8217;t stand not having music going when I&#8217;m working. I often answer the phones, so it was important to me to have an AppleScript that would quickly do the following: Mute the system &#8230; <a href="http://gfmorris.org/archives/2010/06/16/developing-an-on-the-phone-applescript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m now <a href="http://wphelpcenter.com/">working from home</a>, but I can&#8217;t stand not having music going when I&#8217;m working.  I often answer the phones, so it was important to me to have an AppleScript that would quickly do the following:</p>
<ol>
<li>Mute the system volume so I can focus on the customer.</li>
<li>Pause iTunes.</li>
<li>Setting my Adium status as On-the-Phone so my co-workers know I&#8217;m on the phone.</li>
</ol>
<p>The fun thing is that I&#8217;ve got to get the script to do the reverse when invoked again.  Otherwise, what use is it?</p>
<p>My first step was to use <a href="http://leafraker.com/2007/11/13/mute-system-volume-with-apple-script-and-quicksilver/">Leaf Raker&#8217;s suggestion for how to mute the system volume with AppleScript</a>.  The approach there works fine; the only issue is going to be that the system volume returns to 50 when it&#8217;s invoked a second time.  If you&#8217;re always using this script during the day, though, that shouldn&#8217;t be a problem.  Thanks, Leaf Raker, for getting me started!</p>
<p>The second step is pausing iTunes.  If you read the iTunes Applescript Dictionary, you&#8217;ll see that it has a verb &#8220;playpause&#8221; that toggles the status of iTunes.  This is helpful for me when I&#8217;m listening to a podcast while working, because I would like to not lose my place while I&#8217;m on the phone.  So it&#8217;s <code>tell application "iTunes" to playpause</code> to make it happen.</p>
<p>The last step, of course, is the Adium status change.  <a href="http://trac.adium.im/wiki/AppleScript_Support_1.2">The Adium wiki has a page on their AppleScript support</a>, and after a number of tests, I found that this worked:</p>
<pre>
tell application "Adium"
	set thisStatus to the status type of the first account
	if thisStatus is available then
		set the status type of the first account to away
		set the status message of the first account to
		"I'm on the phone; be with you shortly"
	else
		set the status type of the first account to available
		set the status message of the first account to ""
	end if
end tell
</pre>
<p>Now, this only works for my setup because I have the one account in Adium on this machine&#8212;Adium, for me, is dedicated to the IM support I have with work.  Multiple-account setups would take some sniffing; this is done with <code>of account "somename"</code>, rather than &#8220;the first account&#8221;.  Of course, if you&#8217;re in my situation&#8212;working from home, wanting to set your status away when you&#8217;re on the phone&#8212;you probably only have one account in Adium that needs toggling.  [You better not be on multiple IM channels if you're telecommuting, or you won't get anything done!]</p>
<p>The whole script is as follows:</p>
<pre>
set curVol to (get (output volume of (get volume settings)))
if curVol > 0 then
	set volume output volume 0
else
	set volume output volume 50
end if

tell application "iTunes" to playpause

tell application "Adium"
	set thisStatus to the status type of the first account
	if thisStatus is available then
		set the status type of the first account to away
		set the status message of the first account to
		"I'm on the phone; be with you shortly"
	else
		set the status type of the first account to available
		set the status message of the first account to ""
	end if
end tell
</pre>
<p>You can also download this: <a href="http://gfmorris.org/wordpress/wp-content/uploads/2010/06/on-phone.scpt">on-phone.scpt</a>.</p>
<p>As always: shared without license and support.  I&#8217;ll help if you ask questions in the comment, but I am under no obligation to get you to done.  I worked to figure this one out, so you can work, too.  <img src='http://gfmorris.org/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Unlike with <a href="http://gfmorris.org/archives/2010/06/06/update-to-my-spam-reporting-applescripts/">my Mail scripting</a>, I invoke this with the excellent <a href="http://www.obdev.at/products/launchbar/index.html">Launchbar</a>, although I&#8217;m sure that <a href="http://quicksilver.en.softonic.com/mac">Quicksilver</a> will invoke it for you, too.  I just put this in ~/Library/Scripts for safe-keeping.</p>
]]></content:encoded>
			<wfw:commentRss>http://gfmorris.org/archives/2010/06/16/developing-an-on-the-phone-applescript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

