<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>willnorris.com &#187; applescript</title>
	<atom:link href="http://willnorris.com/tag/applescript/feed" rel="self" type="application/rss+xml" />
	<link>http://willnorris.com</link>
	<description>there&#039;s more to life than this</description>
	<lastBuildDate>Tue, 15 May 2012 21:57:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-beta3-20574</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
		<item>
		<title>Bottom posting in Mail.app (with Quicksilver)</title>
		<link>http://willnorris.com/2007/07/bottom-posting-in-mailapp-with-quicksilver</link>
		<comments>http://willnorris.com/2007/07/bottom-posting-in-mailapp-with-quicksilver#comments</comments>
		<pubDate>Wed, 18 Jul 2007 20:23:43 +0000</pubDate>
		<dc:creator>Will Norris</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[bottom-posting]]></category>
		<category><![CDATA[mail.app]]></category>
		<category><![CDATA[netiquette]]></category>
		<category><![CDATA[top-posting]]></category>

		<guid isPermaLink="false">http://willnorris.com/2007/07/bottom-posting-in-mailapp-with-quicksilver</guid>
		<description><![CDATA[John Gruber posted his applescript for Mail.app to &#8220;bottom-post&#8221; reply to an email last week (and I&#8217;m just now reading it, sigh). However, he talks about using FastScripts to invoke the script whereas I prefer Quicksilver for things like this if possible. The advantage of FastScripts is that it grabs the keystroke before the application [...]]]></description>
			<content:encoded><![CDATA[<p>John Gruber posted <a href="http://daringfireball.net/2007/07/non_top_posting_scripts">his applescript</a> for Mail.app to &#8220;bottom-post&#8221; reply to an email last week (and I&#8217;m just now reading it, <em>sigh</em>).  However, he talks about using <a href="http://www.red-sweater.com/fastscripts/">FastScripts</a> to invoke the script whereas I prefer <a href="http://quicksilver.blacktree.com/">Quicksilver</a> for things like this if possible.  The advantage of FastScripts is that it grabs the keystroke before the application does, so no other modification is necessary.  It&#8217;s still possible with Quicksilver, but you need to take a few extra steps.</p>

<p>First set alternate shortcuts for the normal menu options by opening the Keyboard Preference Pane and click on the last tab &#8220;Keyboard Shortcuts&#8221;.  Add a new shortcut, selecting &#8220;Mail&#8221; as the application, &#8220;Reply&#8221; as the menu title, and give it some obscure shortcut (I&#8217;m using &#8984;&#8997;R).  Repeat to remap &#8220;Reply All&#8221; as well (I&#8217;m adding a &#8679; to the previous shortcut).  Relaunch Mail.app for the changes to take effect.  Then you can setup the scripts and assign them as triggers within Quicksilver for use specifically within Mail.app.</p>
]]></content:encoded>
			<wfw:commentRss>http://willnorris.com/2007/07/bottom-posting-in-mailapp-with-quicksilver/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lock Screen</title>
		<link>http://willnorris.com/2005/07/lock-screen</link>
		<comments>http://willnorris.com/2005/07/lock-screen#comments</comments>
		<pubDate>Mon, 18 Jul 2005 17:07:21 +0000</pubDate>
		<dc:creator>Will Norris</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[growl]]></category>
		<category><![CDATA[locktight]]></category>
		<category><![CDATA[quicksilver]]></category>

		<guid isPermaLink="false">http://willnorris.com/2005/07/lock-screen</guid>
		<description><![CDATA[Yet another application (locktight) that I&#8217;ve replaced with Quicksilver&#8230; After reading the comments in this hint at macosxhints.com, I discovered this little bit of applescript. tell application "ScreenSaverEngine" to activate You&#8217;ll want to add this to a Quicksilver trigger so you can it from the keyboard (I use Cmd-Opt-Shift-L because that was the default in [...]]]></description>
			<content:encoded><![CDATA[<p>Yet another application (<a href="http://mac.pieters.cx/">locktight</a>) that I&#8217;ve replaced with <a href="http://quicksilver.blacktree.com/">Quicksilver</a>&#8230;</p>

<p>After reading the comments in <a href="http://www.macosxhints.com/article.php?story=20050706194219822">this hint</a> at macosxhints.com, I discovered this little bit of applescript.</p>

<pre><code>tell application "ScreenSaverEngine" to activate
</code></pre>

<p>You&#8217;ll want to add this to a Quicksilver trigger so you can it from the keyboard (I use Cmd-Opt-Shift-L because that was the default in locktight and I&#8217;m kinda used to it)</p>
]]></content:encoded>
			<wfw:commentRss>http://willnorris.com/2005/07/lock-screen/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>quicksilver and itunes</title>
		<link>http://willnorris.com/2005/06/quicksilver-and-itunes</link>
		<comments>http://willnorris.com/2005/06/quicksilver-and-itunes#comments</comments>
		<pubDate>Mon, 27 Jun 2005 17:26:01 +0000</pubDate>
		<dc:creator>Will Norris</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[quicksilver]]></category>

		<guid isPermaLink="false">http://willnorris.com/?p=43</guid>
		<description><![CDATA[I&#8217;m generally a big fan of the Unix axiom of applications doing one thing and doing it well, but when each of those applications is running all the time and takes up 20MB of active memory I tend to make an exception and Quicksilver is providing an excellent alternative to several smalls apps I use. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m generally a big fan of the Unix axiom of applications doing one thing and doing it well, but when each of those applications is running all the time and takes up 20MB of active memory I tend to make an exception and <a href="http://quicksilver.blacktree.com">Quicksilver</a> is providing an excellent alternative to several smalls apps I use.</p>

<p>I originally used <a href="http://www.ithinksw.com/products/menutunes/">MenuTunes</a>, and most recently <a href="http://synergy.wincent.com/">Synergy</a> to provide global &#8220;hotkeys&#8221; to do some simple things like play/pause iTunes, skip to next or previous track, and display some information about the current track.  Quicksilver&#8217;s triggers are ideal for this &#8212; it allows you to create keyboard shortcuts to perform any Quicksilver action.  This let me setup keys for play/pause and next/previous track.</p>

<p>Additionally I setup the iTunes Quicksilver plugin to display track notifications and to send those notifications to <a href="http://www.growl.info/">Growl</a>, however the plugin only displays notifications when something happens like the track changes.  I want to be able to display track info at any time so I whipped up this simple Applescript, saved it to my scripts folder, and assigned it to a Quicksilver trigger.  This will display the exact same as the built-in iTunes notification in Quicksilver with the addition of track time, current position, and ratings stars.  It&#8217;s a very simple matter of displaying more or less info for the track.</p>

<p><img src="http://willnorris.com/wordpress-content/uploads/2005/06/itunes-notification.jpeg" alt="iTunes notification" /></p>

<p>[updated 09 Aug 2005 to work when no artwork is present]</p>

<pre><code>tell application "iTunes"
  set currentTrack to current track
  set theArtworks to artworks of currentTrack

  if ((count of theArtworks) &gt; 0) then
    set theArtworkData to data of item 1 of theArtworks
  else
    set theArtworkData to null
  end if

  set theArtist to artist of currentTrack
  set theAlbum to album of currentTrack
  set theTime to time of currentTrack

  -- set the rating stars
  set theStars to ""
  set theRating to rating of currentTrack
  set bStar to Â«data utxt2605Â» as Unicode text
  set wStar to Â«data utxt2606Â» as Unicode text
  repeat 5 times
    if (theRating &gt; 0) then
      set theStars to theStars &amp; bStar
      set theRating to (theRating - 20)
    else
      set theStars to theStars &amp; wStar
    end if
  end repeat

  -- get player position and format to MM:SS
  set positionMinutes to (player position div 60)
  if (positionMinutes &lt; 10) then Â¬
    set positionMinutes to "0" &amp; positionMinutes
  set positionSeconds to (player position mod 60)
  if (positionSeconds &lt; 10) then Â¬
    set positionSeconds to "0" &amp; positionSeconds
  set thePosition to positionMinutes &amp; ":" &amp; positionSeconds
end tell

tell application "GrowlHelperApp"
  if (theArtworkData is not null) then
    notify with name Â¬
      "iTunes Notification" title Â¬
      name of currentTrack description Â¬
      theArtist &amp; return &amp; theAlbum &amp; return &amp; thePosition Â¬
        &amp; " / " &amp; theTime &amp; "     " &amp; theStars application name Â¬
      "Quicksilver" pictImage theArtworkData
  else
    notify with name Â¬
      "iTunes Notification" title Â¬
      name of currentTrack description Â¬
      theArtist &amp; return &amp; theAlbum &amp; return &amp; thePosition Â¬
      &amp; " / " &amp; theTime &amp; "     " &amp; theStars application name Â¬
      "Quicksilver" icon of application "iTunes"
  end if
end tell
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://willnorris.com/2005/06/quicksilver-and-itunes/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

