<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Thousand Robots: End Effector</title>
    <link rel="alternate" type="text/html" href="http://thousandrobots.com/blog/" />
    <link rel="self" type="application/atom+xml" href="http://thousandrobots.com/blog/atom.xml" />
    <id>tag:thousandrobots.com,2007-08-15:/blog//1</id>
    <updated>2007-08-19T17:37:30Z</updated>
    <subtitle>Don&apos;t read this every day.</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Publishing Platform 4.0</generator>

<entry>
    <title>Brief thoughts on the iPhone</title>
    <link rel="alternate" type="text/html" href="http://thousandrobots.com/blog/archives/2007/06/brief-thoughts/" />
    <id>tag:thousandrobots.com,2007:/blog//1.5519</id>

    <published>2007-06-30T08:20:44Z</published>
    <updated>2007-08-19T17:37:30Z</updated>

    <summary> I don&apos;t usually do opinion pieces here, but today is sort of a notable day. Here are my general thoughts on the iPhone. it is small and light the virtual keyboard thing is a pain in the ass. i&apos;m...</summary>
    <author>
        <name>ADM</name>
        
    </author>
    
        <category term="Technology" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://thousandrobots.com/blog/">
        <![CDATA[<p>
I don't usually do opinion pieces here, but today is sort of a notable day. Here are my general thoughts on the iPhone.
</p>
<ul>

    <li>it is small and light</li>
    <li> the virtual keyboard thing is a pain in the ass. i'm sure it gets better the more you get used to it, and the auto-correction works well, but it never types the letter you are aiming for. it really slows you down. the keys need to be wider. also, the virtual keyboard gets in the way. for instance, when accessing my gmail, i had to type in a captcha code to sign in, but the keyboard obscured so much screen real estate, i couldn't see the captcha text and the text field at the same time. it also sets the visual focus wherever you are typing, so you can't look at the captcha while typing blindly. i had to memorize the sequence, then scroll down and type it in.</li>
    <li> interface is not as dead simple as you would expect. for instance, in the web browser, i couldn't figure out how to go to a new page! turns out the address bar is pinned to the top of the page, instead of the top of the browser window. SO YOU HAVE TO SCROLL UP on a PAGE to find the address bar. Really poor decision there, and very uncharacteristic of Apple. the apple store employee who i asked about this was puzzled by it and couldn't immediately figure out how it worked.</li>
    <li> it's a little slower than you would hope. for example, when you pan-and-scan a pdf document, the screen redraw takes a second or two. that said, the ability to open up and zoom in and out of a pdf or other attachment is nice.</li>
    <li>the interface across applications is not consistent. forward/back work differently in safari, the notepad, and itunes.</li>
</ul>
<p>
finally: because it is still a closed system, you sit there using it for 15 minutes or so, fooling around with safari, the camera, email, and itunes, and then you realize that you have done everything you can do with it. the words that went through my head were, "Well, I guess that's it." In the end, it's just a cool phone.
</p>
<p>
i don't think i am going to get one. it seems to me that any Nokia Series 60 (aka "N Series") phone does nearly everything that the iPhone does, with the exception of the touch-screen interface, The Nokias have these advantages that are valuable to me:
</p>
<ul>
    <li>GPS (N95 only)</li>
    <li>unlocked; no contract</li>
    <li>multimedia messaging, which was inexplicably left off the iPhone</li>
    <li>3G data</li>
    <li>open architecture, so you can install third-party applications</li>
    <li>way better camera (zeiss lens 5MP vs. run-of-the-mill 2MP)</li>
    <li>video recording (inexplicably left off the iphone; N95 does 480p)</li>
</ul>
<p>sure, the Nokia interface isn't as slick, but it is still very well designed, and probably more efficient for the most common operations (calling people, texting, sending someone a picture).
</p>
<p>
the one caveat for me here is that the iPhone OS X certainly has 1000x more potential than the Series 60/Symbian OS, so if/when Apple opens it up, it will blow away the Nokias and everything else.
</p>]]>
        
    </content>
</entry>

<entry>
    <title>WABC in New York suspends broadcast during fire in studio</title>
    <link rel="alternate" type="text/html" href="http://thousandrobots.com/blog/archives/2007/05/wabc-in-new-yor/" />
    <id>tag:thousandrobots.com,2007:/blog//1.5517</id>

    <published>2007-05-28T05:00:49Z</published>
    <updated>2007-05-28T05:15:31Z</updated>

    <summary>WABC had a fire in the studio tonight, one serious enough to take them off the air:...</summary>
    <author>
        <name>ADM</name>
        
    </author>
    
        <category term="TV" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://thousandrobots.com/blog/">
        <![CDATA[<p>WABC had <a href="http://abclocal.go.com/wabc/story?section=local&id=5344574">a fire</a> in the studio tonight, one serious enough to take them off the air:
</p>
<p>
<a href="/blog/wabc.jpg">
<img src="/blog/wabc_small.jpg" alt="wabc off air" /></a>
</p>]]>
        
    </content>
</entry>

<entry>
    <title>CBS&apos; &quot;blogger&apos;s toolkit&quot; doesn&apos;t work</title>
    <link rel="alternate" type="text/html" href="http://thousandrobots.com/blog/archives/2007/05/cbs-bloggers-to/" />
    <id>tag:thousandrobots.com,2007:/blog//1.5516</id>

    <published>2007-05-17T17:36:21Z</published>
    <updated>2007-05-17T20:54:41Z</updated>

    <summary> CBS offers a &quot;blogger&apos;s toolkit&quot; for fall previews, which doesn&apos;t work. CBS has picked up &quot;Kid&apos;s Nation,&quot; a reality show about a bunch of kids trying to start a civil society in an abandoned town. Thoughtfully, they&apos;ve created a...</summary>
    <author>
        <name>ADM</name>
        
    </author>
    
        <category term="Web" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="broken" label="broken" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="cbs" label="cbs" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="software" label="software" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tv" label="tv" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="web" label="web" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://thousandrobots.com/blog/">
        <![CDATA[<p>
CBS offers a "blogger's toolkit" for fall previews, which doesn't work.
</p>
<p>
CBS has picked up "Kid's Nation," a reality show about a bunch of kids trying to start a civil society in an abandoned town. Thoughtfully, they've created <a href="http://www.cbs.com/primetime/fall_preview_2007/">a website dedicated to all their new shows</a>.
</p>
<p>
At the top of the page is a link to a "blogger's toolkit" which purports to offer embeddable video previews of their shows, and the ability to link directly to these previews. Great idea!
</p>
<p>
Only one problem: It doesn't work.
</p>
<p>
I found the preview clip for Kid Nation, and grabbed the link (<a href="http://www.cbs.com/innertube/?src=ext&vid=139183 ">http://www.cbs.com/innertube/?src=ext&vid=139183</a>), so I could add it to <a href="http://linkit.ning.com">my bookmarking site</a>. I pasted the link to my browser, only to learn (after a long loading delay) that it doesn't link to the video at all! It links to a generic front page on InnerTube, CBS's video site. I gave it a few more tries to make sure it wasn't my error, and I regardless of how I approached it, I could not link directly to the video.
</p>
<p>
After a couple more tries, I gave up, wrote this complaint, and moved on. If anyone can get this to work, let me know. If not, send this one back to the labs, CBS.
</p>
<p>
At least the embeddable stuff works:
</p>
<p>
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="644" height="474" id="FLVPlayer5"><param name="movie" value="http://www.cbs.com/primetime/fall_preview_2007/swf/flv_player.swf" /><param name="salign" value="lt" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="FlashVars" value="&MM_ComponentVersion=1&skinName=http://www.cbs.com/primetime/fall_preview_2007/swf/skin_full&streamName=http://www.cbs.com/primetime/fall_preview_2007/flv/kid_nation_jpega_400K_4x3&autoPlay=false&autoRewind=false" /><embed src="http://www.cbs.com/primetime/fall_preview_2007/swf/flv_player.swf" flashvars="&MM_ComponentVersion=1&skinName=http://www.cbs.com/primetime/fall_preview_2007/swf/skin_full&streamName=http://www.cbs.com/primetime/fall_preview_2007/flv/kid_nation_jpega_400K_4x3&autoPlay=false&autoRewind=false" quality="high" scale="noscale" width="644" height="474" name="FLVPlayer5" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>  
</p>
<p>
Oh, nevermind, I guess that doesn't work either (at least in Firefox). Annoying!
</p>]]>
        
    </content>
</entry>

<entry>
    <title>&quot;Green&quot; houses: US vs. Rio</title>
    <link rel="alternate" type="text/html" href="http://thousandrobots.com/blog/archives/2007/03/green-houses/" />
    <id>tag:thousandrobots.com,2007:/blog//1.5490</id>

    <published>2007-03-18T21:06:39Z</published>
    <updated>2007-03-18T21:09:46Z</updated>

    <summary>US style: Mike Strizki, a civil engineer living in New Jersey has converted his home into a completely energy self-sufficient abode that runs exclusively on a combination of solar and hydrogen power. Using solar panels, a hydrogen fuel cell, storage...</summary>
    <author>
        <name>ADM</name>
        
    </author>
    
        <category term="Technology" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://thousandrobots.com/blog/">
        <![CDATA[<p>US style:</p>
<blockquote>
<p>

    Mike Strizki, a civil engineer living in New Jersey has converted his home into a completely energy self-sufficient abode that runs exclusively on a combination of solar and hydrogen power. Using solar panels, a hydrogen fuel cell, storage tanks, an electrolyzer to split water into Hydrogen and Oxygen, plus a custom made fuel-cell car, Mike benefits from a utility bill of zero dollars, and the comforting feeling that his activities don't produce any pollution. Currently the solution isn't in any way practical for mass adoption -- <strong>the initial cost was $500,000</strong>, with half paid by New Jersey state grants -- but Mike thinks that he could reduce this cost tenfold with more research and mass market production lines. There is also some concern amongst experts like Joseph Romm, a former Department of Energy official who thinks that the current relatively inefficient technology and the high cost means that this isn't a viable system for mass adoption just yet. Despite this criticism, Mike says "we have to start somewhere," even if early adopters (in this case rich Hollywood types with a conscience) are required to pay out up to $250,000 dollars to get in on the clean energy action. [<a href="http://www.engadget.com/2007/03/17/homeowner-of-solar-hydrogen-house-has-0-00-utility-bill/">source</a>]
</p>
</blockquote>
<p>
Rio style:
</p>
<blockquote>
<p>
    RIO DE JANEIRO (Reuters) - A floating house built out of trash in a reeking channel of a Rio de Janiero slum will be preserved as a model for recycling in a government anti-pollution campaign.
</p>
 <p>
Luiz Bispo says his house [is] kept afloat by hundreds of empty plastic bottles...
</p>
<p>
    Bispo, who earns a living by doing occasional repair and construction work, said he <strong>spent about $170 to build the house</strong>, mainly on cement and roof material. The rest came from construction waste and furniture he found at dump sites. [<a href="http://news.yahoo.com/s/nm/20070318/sc_nm/brazil_environment_floatinghome_dc_1">source</a>]
</p>
</blockquote>]]>
        
    </content>
</entry>

<entry>
    <title>This is broken</title>
    <link rel="alternate" type="text/html" href="http://thousandrobots.com/blog/archives/2006/12/this-is-broken/" />
    <id>tag:thousandrobots.com,2006:/blog//1.5434</id>

    <published>2006-12-07T00:32:53Z</published>
    <updated>2006-12-07T00:41:16Z</updated>

    <summary> Yahoo&apos;s redesigned TV site has not quite nailed the Tivo integration yet. Looks like there&apos;s a null timestamp behind-the-scenes somewhere, hence the pre-epoch date....</summary>
    <author>
        <name>ADM</name>
        
    </author>
    
        <category term="Tivo" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Web" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://thousandrobots.com/blog/">
        <![CDATA[<p>
Yahoo's <a href="http://www.techcrunch.com/2006/11/30/yahoo-tv-gets-a-new-do/">redesigned</a> TV <a href="http://tv.yahoo.com">site</a> has not quite nailed the Tivo integration yet.
</p>
<p class="center">
<img alt="tivo.jpg" src="http://thousandrobots.com/blog/files/tivo.jpg" />
</p>
<p>
Looks like there's a null timestamp behind-the-scenes somewhere, hence the <a href="http://en.wikipedia.org/wiki/Unix_epoch">pre-epoch</a> date.
</p>]]>
        
    </content>
</entry>

<entry>
    <title>How to process AOL&apos;s search logs with PHP</title>
    <link rel="alternate" type="text/html" href="http://thousandrobots.com/blog/archives/2006/08/how-to-process/" />
    <id>tag:thousandrobots.com,2006:/blog//1.5359</id>

    <published>2006-08-07T22:04:50Z</published>
    <updated>2006-08-17T17:24:22Z</updated>

    <summary> AOL, for some reason, released 2,000,000 search records taken from the last 3 months. With a tiny bit of programming, you can use PHP to search through these records. This post describes how. But first, let&apos;s cut to the...</summary>
    <author>
        <name>ADM</name>
        
    </author>
    
        <category term="How To" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Software" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://thousandrobots.com/blog/">
        <![CDATA[<p>
AOL, for some reason, <a href="http://consumerist.com/consumer/research/aol-apologizes-for-splooging-your-searches-192624.php">released 2,000,000 search records</a> taken from the last 3 months. With a tiny bit of programming, you can use PHP to search through these records. This post describes how.
</p>
<p>But first, let's cut to the chase:</p>
<ul>
<li><a href="/projects/aol/search.php?search=honda">Working example</a> (expect "Internal Server Error" when under load)</li>
<li><a href="/projects/aol/search.phps">Source code</a></li>
</ul>
<p>
First, you need to download the files, which you'll have to find on your own, as I can't remember where I found them. The file is ~450MB.
</p>
<pre>
<code>
wget http://whereverthosefilesare.com/AOL-data.tgz
</code>
</pre>
<p>
Next, uncompress this file into its multiple parts:
</p>
<pre>
<code>
tar zxvf AOL-data.tgz
</code>
</pre>
<p>
Then, un-gzip the compressed files:
</p>
<pre>
<code>
gzip -f user*.gz
</code>
</pre>
<p>
This will leave you with a bunch of text files containing the actual log data. These files will be very large. So large in fact that your web server might not be able to deal with them in PHP. So, you should split them into multiple smaller files. For each .txt file, run a command such as:
</p>
<pre>
<code>
csplit -f aol user*01.txt 1000 {1000} &amp;
</code>
</pre>
<p>
That code will split the files into multiple files of 1000 lines each, naming each them <code>aol100, aol101</code> and so on. In these smaller chunks, PHP will be able to deal with them more easily. When I ran this command, I ended up with 2000 files of 1000 lines each. For the code below to work, each of these files must have the letters "aol" in their names.
</p>
<p>
Next, you can create a PHP page that will search the AOL log files for a certain string, and then return matching lines. The string you are looking for will be passed on the URL, as in http://example.com/search.php?search=sex
</p>
<p>
Here is <a href="http://thousandrobots.com/projects/aol/search.phps">the code for the PHP page</a>.
</p>
<p>
Save the file as <code>search.php</code> or whatever, and then access it at its url, e.g., http://yourwebsite.com/search.php?search=thewordyouarelookingfor
</p>
<p>
Change the URL to run another search. You can take the user id from one search and put it on the URL, thereby finding all the searches by that user.
</p>]]>
        
    </content>
</entry>

<entry>
    <title>How to Make Google Your Default Search Provider in Internet Explorer 7, Beta 2</title>
    <link rel="alternate" type="text/html" href="http://thousandrobots.com/blog/archives/2006/05/how-to-make-goo/" />
    <id>tag:thousandrobots.com,2006:/blog//1.5312</id>

    <published>2006-05-01T22:43:42Z</published>
    <updated>2006-05-02T16:51:39Z</updated>

    <summary>Google is complaining to the Department of Justice and the EU that Microsoft&apos;s forthcoming Internet Explorer 7 improperly encourages users to use MSN Search instead of a search engine of the user&apos;s choice. Google claims &quot;research it has sponsored shows...</summary>
    <author>
        <name>ADM</name>
        
    </author>
    
        <category term="How To" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Technology" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://thousandrobots.com/blog/">
        <![CDATA[<p>Google is <a href="http://slashdot.org/articles/06/05/01/1549234.shtml">complaining</a> to the Department of Justice and the EU that Microsoft's <a href="http://www.microsoft.com/windows/ie/default.mspx">forthcoming Internet Explorer 7</a> improperly encourages users to use MSN Search instead of a search engine of the user's choice. Google claims "research it has sponsored shows that it's difficult to change the settings in the new browser to a rival search engine."
</p>
<p>
I decided to do a little research of my own to see how "difficult" it is. Please watch this video:
</p>
<p class="center">
<a href="/blog/files/google.wmv"><img src="/blog/files/googlesearch.png" alt="ie7 search" /></a>
</p>
<p>
[Sorry about using WMV. I hate it too.]
</p>
<p>
As you can see, it is a very simple 10-second process that most people could figure out without much effort.
</p>
<p>
I dislike IE and never use it, and I think Google is a great search engine, but it seems to me they are reaching a bit on this one. If it were me, I guess what I would ask is that Microsoft document how to create whatever kind of file it is that lets the toolbar's search feature use a given provider. They may have already done this -- I'm not sure. <strong>Update:</strong> Not only have they already done that, but the little plug-in or whatever you call it uses <a href="http://opensearch.a9.com/">A9's OpenSearch</a> format.
</p>]]>
        
    </content>
</entry>

<entry>
    <title>How to use iTunes &quot;currently playing&quot; info as your email signature in Outlook</title>
    <link rel="alternate" type="text/html" href="http://thousandrobots.com/blog/archives/2006/04/how-to-use-itun/" />
    <id>tag:thousandrobots.com,2006:/blog//1.5304</id>

    <published>2006-04-10T16:00:35Z</published>
    <updated>2006-04-11T04:06:28Z</updated>

    <summary> Ok, here&apos;s one for the masses. This post describes how to add info about the song currently playing in iTunes to emails you compose in Outlook. Anyone can do it! First, create the macro. To do so: Open Outlook....</summary>
    <author>
        <name>ADM</name>
        
    </author>
    
        <category term="How To" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Projects" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Software" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://thousandrobots.com/blog/">
        <![CDATA[<p class="center">
<img src="/blog/files/outlook_macro/demo.png" alt="outlook with itunes screenshot" />
</p>
<p>
Ok, here's one for the masses.
</p>
<p>
This post describes how to add info about the song currently playing in iTunes to emails you compose in Outlook. Anyone can do it!
</p>
<p>First, create the macro. To do so:</p>
<ol>
<li>Open Outlook.</li>
<li>From the Tools menu, select Macro, then Macros...</li>
<li>In the Macro field, enter a name for your macro. "AddiTunesSig" is probably appropriate. [<a href="/blog/files/outlook_macro/macro.png">screenshot</a>]</li>
<li>Click "Create".</li>
<li>A "code window" will open. This is where, in a minute, you will type the code that makes up the macro.</li>
<li>But first, you need to tell Outlook how to talk to iTunes. To do so, go to the Tools menu and select References. Scroll down until you find "iTunes Type Library" or something similar. Select its checkbox and click OK. [<a href="/blog/files/outlook_macro/references.png">screenshot</a>]</li>
<li>Back in the code window, you will see two lines of code: <code>Sub AddiTunesSig()</code> and <code>End Sub</code>. In between these lines, paste in the following code:
<pre>
<code>

' purpose: opens a new mail message, 
' appends info re: currently playing track in iTunes

Dim itunes As iTunesApp
Dim strArtist As String
Dim strTitle As String
Dim strOutput As String
Dim mail As Outlook.MailItem

Set itunes = New iTunesApp

'load the track info into easy-to-read variables
strArtist = itunes.CurrentTrack.Artist
strTitle = itunes.CurrentTrack.Name
strAlbum = itunes.CurrentTrack.Album

'assemble the signature
strOutput = vbNewLine &amp; "------------------------------"
strOutput = strOutput &amp; vbNewLine &amp; "Now playing: " &amp; vbCrLf _
     &amp; strTitle &amp; vbCrLf &amp; strArtist &amp; vbCrLf &amp; strAlbum

'create a new email message
Set mail = Outlook.CreateItem(olMailItem)

'put the signature in the body
mail.Body = vbNewLine &amp; vbNewLine &amp; strOutput

'show the message to the user
mail.Display

'clear up the memory
Set itunes = Nothing
</code>
</pre>
<p>
See how easy programming is! [<a href="/blog/files/outlook_macro/code_window.png">screenshot</a>]
</p>
</li>
<li>To finish up: Click the Save button on the toolbar and close the code window.</li>
</ol>
<p>
Now, you need to add a toolbar button to your Outlook toolbar that will run this macro. To do so:
</p>
<ol>
<li>Go to the Tools menu, and select Customize...</li>
<li>In the dialog box that pops up, scroll down the left side, and click Macros. [<a href="/blog/files/outlook_macro/customize.png">screenshot</a>]</li>
<li>You will see your macro on the right ("Project1.AddiTunesSig"). Drag it up to a convenient location on your toolbar. (Next to the "New" button is probably a good place.)</li>
<li>To rename the button, right-click the button and type the new name where it says "Name:" in the pop-up menu. "New (with music)" is probably a good name. [<a href="/blog/files/outlook_macro/rename.png">screenshot</a>]</li>
<li>Close the Customize window.</li>
</ol>
<p>
That's it! To use it, open iTunes, play a song, go back to Outlook, and click your new button. A new email will open with info about the currently playing song in the signature area.
</p>
<p>
Earlier: <a href="/blog/archives/2006/01/how_to_control_1.php">How to control iTunes from any Microsoft Office application</a>.
</p>]]>
        
    </content>
</entry>

<entry>
    <title>How to make a mobile wifi hotspot using your Bluetooth-enabled Sprint PCS phone and your Mac</title>
    <link rel="alternate" type="text/html" href="http://thousandrobots.com/blog/archives/2006/04/how-to-set-up-y/" />
    <id>tag:thousandrobots.com,2006:/blog//1.5298</id>

    <published>2006-04-03T01:36:53Z</published>
    <updated>2006-04-10T22:49:52Z</updated>

    <summary> Let&apos;s say Sprint happened to to send you a free phone with a free service plan as part of their Ambassador program. Wouldn&apos;t you want to share the benefit of that service with as many people as possible? Especially...</summary>
    <author>
        <name>ADM</name>
        
    </author>
    
        <category term="Cellphones" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="How To" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Technology" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://thousandrobots.com/blog/">
        <![CDATA[<p>
Let's say Sprint happened to to send you a free phone with a free service plan as part of their Ambassador program. Wouldn't you want to share the benefit of that service with as many people as possible? Especially if the plan included free data service? After all, Mr. Ambassador, you certainly want everyone to enjoy Sprint's quality service as much as you do, right?
</p>
<p>
Or let's say you're so rich you can afford to pay Sprint's (probably high) fees for unlimited data service. Since there's no additional cost to you, shouldn't you share some of that bandwidth with some of us poor saps who can't afford such luxuries?
</p>
<p>
This post describes how to use your Bluetooth- and Airport-enabled Mac with your Bluetooth-enabled Sprint PCS phone to set up a mobile wifi access point. Meaning, you can put your iBook in your car or backpack, put your phone in your pocket, and give free wifi internet access to anyone who happens to be in the area. (Of course, you will also be able to access the internet yourself all the while.)</p>
<p>
These instructions assume you are using Mac OS X 10.4 (Tiger), and a Samsung A920, the official phone of Sprint Ambassadors everywhere. But they should apply to any Sprint phone with Bluetooth that is capable of being a data modem and/or using their Power Vision service. Non-ambassadors will have to navigate <a href="/blog/archives/2006/03/sprint_pcs_the.php">the labyrinth of Sprint customer service</a> and get "phone-as-modem" service added to their plan. Once you've gotten that taken care of, please continue...
</p>
<h3>
Summary for experienced people
</h3>
<p>Details are below, but if you know what you're doing and just want to do it quickly:
</p>
<ol>
<li>Turn on Bluetooth on your phone.</li>
<li>Pair your phone with your Mac.</li>
<li>In the PPP configuration for Bluetooth in Network preferences, leave the username and password blank and use this phone number: <code>#777</code></li>
<li>In Sharing preferences, go to the Internet pane and turn on Internet Connection Sharing for Bluetooth, allowing AirPort devices to connect.</li>
<li>Back in PPP, click "Dial Now...". You should be all set. By default, your SSID will be your computer's name.</li>
<li>If you need a detailed step-by-step, continue reading...</li>
</ol>

<h3>
First, set up the phone
</h3>
<ol>
      <li>Press "Menu/OK".</li>
      <li>Select "Settings".</li>
      <li>Scroll down and select "Bluetooth" and press OK.</li>
      <li>If Bluetooth is disabled, click OK on to enable it.</li>
      <li>Set "Visibility" to "Always visible". (This is optional and not very secure, but it might make things easier later.)</li>
      <li>Select "Device Name" and enter a nice name for your phone. This is the name other Bluetooth devices (like your Mac) will display when connecting to your phone. (I have found in other contexts that choosing a one-word name can reduce errors.)</li>
</ol>
<h3>
Connect your Mac to your phone via Bluetooth
</h3>
<ol>
<li>Open System Preferences.</li>
<li>In the Hardware section, click Bluetooth.</li>
<li>In the Settings pane, make sure it says Bluetooth is on. Other than that, it doesn't matter much what is selected. [<a href="/blog/files/bluetooth_tutorial/bluetooth_settings.png">screenshot</a>]</li>
<li>In the Devices pane [<a href="/blog/files/bluetooth_tutorial/bluetooth_devices.png">screenshot</a>], click "Setup New Device".</li>
<li>The Bluetooth Setup Assistant wizard will start. Click "Continue" and select "Mobile phone" from the list of device types.</li>
<li>The wizard will scan the airwaves looking for Bluetooth devices. When you see the name of your phone, select it and click "Continue".</li>
<li>After a few seconds of "gathering information," the wizard will prompt you to click "Continue" to continue. Do so.</li>
<li>Your computer will display a "passkey", a number you have to type into your phone to "pair" the phone with your Mac. [<a href="/blog/files/bluetooth_tutorial/bluetooth_pairing.png">screenshot</a>]</li>
<li>Your phone will prompt you to accept the pair. Press "Accept".</li>
<li>Enter the passkey into your phone and press OK. If you wait too long, the connection will time out, and you'll probably have to go back in the wizard and get a new passkey.</li>
<li>Once the pairing has taken place, click "Continue" to continue.</li>
<li>Make sure "Access the internet with your phone's data connection" is checked.</li>
<li>Click "Continue".</li>
<li>Here's the important part: You will be prompted to enter connection settings. Leave "Username" and "Password" blank. In "Phone Number", enter <code>#777</code>. For "Modem Script", select "Sprint PCS Vision".  [<a href="/blog/files/bluetooth_tutorial/bluetooth_data_settings.png">screenshot</a>]</li>
<li>Optionally, select the checkboxes to show Bluetooth and Modem status in the menu bar.</li>
<li>Click "Continue".</li>
<li>Click "Quit".</li>
</ol>

<h3>
Connect to the Internet
</h3>
<p>At this point, you might want to  turn off Airport and/or unplug your network cable, so that when you connect to the internet via the phone, you'll be sure you are connected via the phone. (After it's all set up, you can turn Airport back on.) In the meantime, here's how to get connected:</p>
<ol>
<li>Open System Preferences. (Or click "Show All" if your Bluetooth panel is still active.)</li>
<li>In the Network &amp; Internet section, choose "Network".</li>
<li>In the dropdown labeled "Show", select "Bluetooth".</li>
<li>In the "PPP" pane, make sure "Account Name" and "Password" are blank, and that "Telephone Number" is <code>#777</code>.</li>
<li>In the "Bluetooth Modem" pane, make sure the Modem dropdown says "Sprint PCS Vision", and (optionally) check all checkboxes. Now you're ready to connect to the internet.</li>
<li>Go back to the "PPP" pane, and click "Dial Now..." An "Internet Connect" dialog box will appear. Make sure the Bluetooth pane is showing. [<a href="/blog/files/bluetooth_tutorial/bluetooth_dialing.png">screenshot</a>]</li>
<li>Click "Connect". The modem status in the menu bar will read "Connecting..." and your phone will say "Connected as data modem to [your computer name]". You are connected! A timer on the phone will show the duration of your connection.</li>
<li>Open a web browser on your computer to confirm that you are connected.</li>
</ol>

<h3>Share your internet connection via AirPort</h3>
<p>Now you are ready to share your connection to the internet with other users. To do so:</p>
<ol>
<li>Turn AirPort back on if you turned it off earlier.</li>
<li>Return to System Preferences. (Click "Show All" if you are still on your Network settings.)</li>
<li>In "Internet &amp; Network", click "Sharing".</li>
<li>Go to "Internet" pane. [<a href="/blog/files/bluetooth_tutorial/internet_sharing.png">screenshot</a>]</li>
<li>In the dropdown labeled "Share your connection from", select "Bluetooth".</li>
<li>In the "To computers using" area, select "AirPort".</li>
<li>Click "AirPort options" to make sure encryption is not turned on and/or to change the name of the access point (SSID) that your Mac will broadcast .</li>
<li>Click "Start" to start sharing your internet connection via wifi.</li>
<li>You may get a message saying this conflicts with your firewall setting, as Personal Web Sharing must be turned on (for some reason) to share your internet connection. If there's a dialog, click "Show Services" or directly open the "Services" pane in Sharing (which partially controls your firewall), and activate "Personal Web Sharing" service. Note that this will make the "Sites" folder in your home directory available via your network connection. (If someone can explain to me why Personal Web Sharing has to be turned on in order to share your internet connection, I'd love to hear it. If it's just to open the port, couldn't they do that without firing up your web server?)</li>
<li>That's it! You're connected and you're sharing your connection. You might want to <a href="/blog/files/bluetooth_tutorial/ipaq.jpg">test it with another wifi device</a> to make sure it can connect. (By default, your Mac will broadcast its name as the the name of the access point (SSID)).</li>
</ol>
<p>
<strong>Potentially sad note:</strong> Some devices may not be able to obtain an IP address from your Mac, in which case they won't be able to use your connection to the internet. However, if you can talk to whoever is attempting to share your connection (e.g., you're over at your friends' house and want to get them online), you can configure their network connection manually. To do so, follow <a href="http://www.macosxhints.com/article.php?story=20051119155606277">these instructions</a>. I'd recommend keeping the IP addresses of some public DNS servers handy, so you can just type those in instead of trying to determine them from the <code>dig</code> utility or similar. I really don't know anything about Internet Connection Sharing on the Mac, so I have no idea which devices can automatically obtain an IP from it and which can't.
</p>
<p><strong>Added bonus:</strong> Note that if you look at the Personal Web Sharing preferences, you'll see your external IP has been resolved to an actual domain name like <code>http://h460c83c6.area2.spcsdns.net</code>. Anyone accessing that address in their browser will see whatever website your Mac is serving from its web server folders.
</p>
<p><strong>Keep in mind:</strong></p>
<ul>
<li>Sprint PCS may or may not like the idea of you sharing your bandwidth. (Especially if you're not an Ambassador and don't have diplomatic immunity.)</li>
<li>If you are at work or school, your network administrator may or <a href="http://72.14.203.104/search?q=cache:8Q-Jv3q4LyMJ:www.stanford.edu/services/ess/mac/docs/osxresources/osxshare.html+fire+brimstone">may not like</a> (1) your computer's new-found role as a DHCP server, and (2) your computer giving indirect access to his/her LAN.</li>
</ul>
<p>Even so, at least you can go to bed knowing you are the Robin Hood of wireless bandwidth!</p>


]]>
        
    </content>
</entry>

<entry>
    <title>Images taken from Tivo&apos;s hard drive</title>
    <link rel="alternate" type="text/html" href="http://thousandrobots.com/blog/archives/2006/04/images-taken-fr/" />
    <id>tag:thousandrobots.com,2006:/blog//1.5297</id>

    <published>2006-04-02T20:23:04Z</published>
    <updated>2006-04-12T18:29:56Z</updated>

    <summary> Someone else has probably posted these before, but it&apos;s new to me, so I&apos;m posting them. In this Flickr set, you can see various image files I took from Tivo&apos;s /tvbin directory. Each image is an error message or...</summary>
    <author>
        <name>ADM</name>
        
    </author>
    
        <category term="Tivo" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://thousandrobots.com/blog/">
        <![CDATA[<p class="center">
<a href="http://flickr.com/photos/thousandrobots/sets/72057594096987960/"><img src="/blog/files/tivomessages.png" alt="tivo messages" /></a>
</p>
<p>
Someone else has probably posted these before, but it's new to me, so I'm posting them. In <a href="http://flickr.com/photos/thousandrobots/sets/72057594096987960/">this Flickr set</a>, you can see various image files I took from Tivo's /tvbin directory. Each image is an error message or some kind of prompt. I got these by putting my Tivo's hard drive in a USB enclosure and mounting it on my Mac, using the handy <a href="http://sourceforge.net/projects/ext2fsx/">ExtFS Manager</a>, which lets you mount ext2 and ext3 formatted drives on your Mac.
</p>]]>
        
    </content>
</entry>

<entry>
    <title>How to break a combination lock with a screwdriver</title>
    <link rel="alternate" type="text/html" href="http://thousandrobots.com/blog/archives/2006/03/how-to-break-a/" />
    <id>tag:thousandrobots.com,2006:/blog//1.5291</id>

    <published>2006-03-28T04:38:39Z</published>
    <updated>2006-04-10T22:52:35Z</updated>

    <summary> Last year, there was some coverage of a slow, but effective, technique to open a Master combination lock. If you don&apos;t need to save the lock and don&apos;t have time to go through the algorithm, you might want to...</summary>
    <author>
        <name>ADM</name>
        
    </author>
    
        <category term="How To" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://thousandrobots.com/blog/">
        <![CDATA[<p>
Last year, there was some coverage of a <a href="http://www.hackaday.com/entry/1234000640047476/">slow, but effective, technique</a> to open a Master combination lock. If you don't need to save the lock and don't have time to go through the algorithm, you might want to just try opening it with a screwdriver, as shown in this video I made:
</p>
<p class="center">
<a href="/blog/files/combination_lock.mp4"><img src="/blog/files/combination_lock.png" alt="master combination lock" /></a>
</p>
<p>
I'm not sure if this video just demonstrates the obvious -- I wasn't even sure it was worth a post -- but I thought I'd provide it just in case. I learned that this would work when I was about 12 years old, so it's not a very sophisticated approach.
</p>
<p>
The lock shown in the video is not a Master Lock, but the technique works with those, too. You might need something a little narrower to pry the dial up, and it takes a little longer, but it shouldn't take more than about 5 minutes. I don't know anything about locks, really. If I did, the video would probably be about 75 percent shorter. (You can see me poking at various irrelevant parts of the lock in the video.)
</p>
<p>
The best technique, in my opinion, is <a href="http://www.i-hacked.com/index.php?option=content&amp;task=view&amp;id=189">the shim</a>. But if you don't have a shim, the screwdriver technique is not a bad option.
</p>
<p>
ps. the video is an an iPod-compatible mpeg4.
</p>]]>
        
    </content>
</entry>

<entry>
    <title>Sprint PCS: The Gang That (Usually) Can&apos;t Shoot Straight</title>
    <link rel="alternate" type="text/html" href="http://thousandrobots.com/blog/archives/2006/03/sprint-pcs-the/" />
    <id>tag:thousandrobots.com,2006:/blog//1.5283</id>

    <published>2006-03-11T22:13:06Z</published>
    <updated>2006-04-10T22:54:11Z</updated>

    <summary>A couple weeks ago, Sprint PCS invited me to participate in its &quot;Sprint Ambassador Program,&quot; a program under which they give you a free phone and unlimited use of a premium plan for six months, no strings attached. I received...</summary>
    <author>
        <name>ADM</name>
        
    </author>
    
        <category term="Cellphones" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Technology" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://thousandrobots.com/blog/">
        <![CDATA[A couple weeks ago, Sprint PCS invited me to participate in its "Sprint Ambassador Program," a program under which they give you a free phone and unlimited use of a premium plan for six months, no strings attached. I received the phone today, and tried to use it as a modem, which the program literature suggested was possible.

Although this story ended happily, it wasn't before I was reminded, at length, of why I left Sprint PCS back in the late 90s: <a href="http://tinyurl.com/n4cba">their legendarily bad customer service</a>. 

The phone, a <a href="http://www.samsung.com/Products/MobilePhones/Sprint/SPH_A920WSSXAR.asp">Samsung A920</a>, arrived today, pre-activated. I had some fun exploring its various features, like music downloads (free for Ambassador participants, $2.50(!) for regular customers), video streaming, web browsing, etc.

But when I tried to set it up as a modem (via Bluetooth) and ran into questions, I quickly encountered Sprint's frustrating customer service apparatus, still spotty after all these years. 

All I needed was the phone number to enter into my Bluetooth setup. I thought this information might be on their website. But it turned out I needed a password so I could log on to confirm I was signed up for data service, etc. According to the informational card shipped with my phone, this password defaults to the last four digits of my SSN. Easy enough, right? But of course it didn't work.

After a few tries, I clicked the "I don't know my password" link. The resulting page told me it couldn't reconcile my number with my password. I already knew that. Time to call my old friends at Sprint PCS customer service...

Dial *2, tell the robots I need tech support, get a CSR (not a tech guy) on the phone. I tell him I just got the phone today via the Ambassador program, I'm trying to use it as a modem, and I need a password so I can logon to the site and add that service to my plan. It didn't take long for the conversation to turn Kafka-esque as these conversations always do: 

<strong>CSR:</strong> "I need your password before I can give you that information, sir."
<strong>Me:</strong> "Um. What I was saying is that according to this informational card that came with the phone, my password is supposed to be the last four digits of my social security number. Those numbers didn't work, so I don't know what my password is." 
<strong>CSR:</strong> "Sir, I can't give you the information you need unless you can give me the password for this account."

Start over. Finally he determines my account is a business account, so he transfers me over to that department. I tell the new guy my situation and what I need.

<strong>Business CSR:</strong> "Who is the point of contact for your account."
<strong>Me:</strong> "I don't know...Me?"
<strong>Business CSR:</strong> "I'm seeing this is a large account with a large number of phones, so you need to get in touch with the point of contact for this account."
<strong>Me:</strong> "I think the point of contact is you. Like I said, you guys sent me the phone...you know, for review purposes."
<strong>Business CSR:</strong> "I understand."

Puts me on hold for two minutes, comes back and tells me I need to call ANOTHER number: (888) 296-8806, which apparently is the Ambassador hotline or whatever. Having been down these "special number" paths before, I asked him twice if they would be open right then (Saturday, 5 pm EST). He says yes.

I call the number. Guess what? Dead air. Nothing. Not a ring, not a busy signal, nothing.

Hurray for Sprint PCS! Consistently offering crappy customer service for almost 10 years!

After this, I tried the "I don't know my password" link on the website again, and this time it worked! Apparently they did something to resolve the purgatorial status of my account, and I got an SMS with my new pw. The pw worked.

So at this point, I figured all I need is the phone number to enter in my Bluetooth setup dialog. Can't find that in any of the documentation, online or otherwise, so that's another call to customer service. This time, I get a CSR who tells me my demo plan doesn't support "phone as modem" features but transfers me to a tech anyway. The tech -- who is named Roy (I think) -- is really good -- tells me what number to type in to the Bluetooth dialog (#777), and tells me to give it a shot. No dice. 

He then discovers the special Ambassador service number, and gives it to me, but I tell him I already tried it and all I got was dead air. He tries it and gets dead air, too. He says he'd look into it, and I tell him I'd email the the Ambassador people and see if they could get me set up with a data plan, which at this point I still thought I didn't have (since that's what the CSR told me). Not an ideal solution, but at least he was trying to be helpful and knew what he was talking about.

About 10 minutes later, a tech named Jeff called my PCS phone. He told me he had talked to Roy and wanted to help me get my phone working as a modem.

He explained the root cause of my inability to get online with the phone. This is really funny:

Sprint gave all these Ambassador phones a username like "ambassadorNNNN@sprintpcs.com," where <code>NNNN</code> is a unique four-digit number. When you access the web via the phone's browser, it sends that username and your pw to their server and logs you on. BUT when you try to access the data service using the same phone as a modem, it sends a different username (e.g., ambassadorNNNN@modem.sprintpcs.com). Unfortunately, their system prohibits usernames with obscene words in them. Can you see where this is going? They system parsed the username "ambassadorNNNN", found the "obscene" word "ASS" in it, and refused to provision the account.

The solution Jeff came up with? He changed my username to "ambasadorNNNN" (one 's') and tried the provisioning again. It worked. The only remaining problem was that I then couldn't connect to the internet via the phone's browser, but that situation resolved itself a short time later.

So to summarize: To use my phone as a modem, I talked to five people at Sprint, two of whom (Jeff and Roy) seemed to know what they were talking about, used one faulty website, was wrongly told my plan did not include a data component, and was directed to a dead phone line. All as a member of this Ambassador program.

Please note that I am the last person on Earth to expect special treatment as a member of a premium group (especially one I'm not paying for). I just think it's funny that Sprint had such trouble providing simple information to a member of a group they had internally designated as high-profile.

Finally, the data service, which I will probably be writing about some time in the future, is very good and feels very fast. I will do some formal upload/download tests later and post the results.]]>
        
    </content>
</entry>

<entry>
    <title>Translate news.google.cn with google.com/translate</title>
    <link rel="alternate" type="text/html" href="http://thousandrobots.com/blog/archives/2006/02/translate-newsg/" />
    <id>tag:thousandrobots.com,2006:/blog//1.5248</id>

    <published>2006-02-07T07:31:29Z</published>
    <updated>2006-04-10T22:56:39Z</updated>

    <summary> Not sure if anyone else has thought to do this yet... Google News, via the censored Google.cn, translated into English by Google&apos;s automatic translator...</summary>
    <author>
        <name>ADM</name>
        
    </author>
    
        <category term="Web" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://thousandrobots.com/blog/">
        <![CDATA[<p class="center">
<a href="http://tinyurl.com/mkvns">
<img src="/blog/files/google_china_translated.png" alt="google news translated" />
</a>
</p>
<p>
Not sure if anyone else has thought to do this yet...
</p>
<p>
<a href="http://tinyurl.com/mkvns">Google News, via the censored Google.cn, translated into English by Google's automatic translator</a>
</p>]]>
        
    </content>
</entry>

<entry>
    <title>Max OS X widget for Radio Paradise playlist</title>
    <link rel="alternate" type="text/html" href="http://thousandrobots.com/blog/archives/2006/01/max-os-x-widget/" />
    <id>tag:thousandrobots.com,2006:/blog//1.5236</id>

    <published>2006-01-31T03:17:55Z</published>
    <updated>2006-04-12T18:10:34Z</updated>

    <summary> I made a Mac OS X Dashboard widget that displays the current playlist from RadioParadise.com, a great internet radio station. It&apos;s my first ever widget, so it&apos;s not very fancy, but it gets the job done. The widget shows...</summary>
    <author>
        <name>ADM</name>
        
    </author>
    
        <category term="Projects" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Software" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://thousandrobots.com/blog/">
        <![CDATA[<p class="postimage">
<a href="/blog/files/rpwidget_big.png"><img src="/blog/files/rpwidget.png" alt="radio paradise widget" /></a>
</p>
<p>
I made a Mac OS X Dashboard widget that displays the current playlist from <a href="http://radioparadise.com">RadioParadise.com</a>, a great internet radio station. It's my first ever widget, so it's not very fancy, but it gets the job done.
</p>
<p>
The widget shows a scrollable list of the last 6 hours worth of music played, and if you click a song title, it opens the web page on RP's site dedicated to that song. Clicking the main logo takes you to RP's site. It refreshes when you show the Dashboard and you can manually refresh it by clicking the "refresh" link. I may add automatic refreshing in some future release.
</p>
<ul>
<li><a href="/projects/rp/widget/osx/Radio Paradise.wdgt.zip">Download the Radio Paradise playlist widget</a></li>
<li><a href="/projects/rp/widget/osx/source/">View source code/source files</a></li>
</ul>
<p>
Once you've downloaded the widget, unzip it by double-clicking it, then double-click the widget file. For older versions of Mac OS X, you might need to move the files into your home folder's /Library/Widgets folder first.
</p>
 <p>
Apple doesn't seem to publicize this fact, but practically anyone can make a widget. Simple widgets are really just small web pages, and can be made using only HTML, JavaScript, and a couple of images. You should give it a try. I just read <a href="http://developer.apple.com/macosx/dashboard.html">Apple's excellent tutorial</a>, looked at the source code for one of their <a href="http://developer.apple.com/samplecode/SampleRSS/SampleRSS.html">RSS-reading sample widgets</a>, and went from there.
</p>
<p>
This widget uses JavaScript to extract data from an XML version of RP's playlist. I believe it is technically an AJAX-based widget, albeit a very simple one. A few weeks ago, I <a href="/blog/archives/2004/10/rss_feed_for_ra.php">wrote a PHP script</a> that generates an RSS feed from that XML.
</p>
<p>
I'm guessing it's trivial to convert Mac OS X widgets to <a href="http://widgets.yahoo.com/">Konfabulator/Yahoo! Widgets</a>, so I will do that when I get a minute.
</p>]]>
        
    </content>
</entry>

<entry>
    <title>How to control iTunes from any Microsoft Office application</title>
    <link rel="alternate" type="text/html" href="http://thousandrobots.com/blog/archives/2006/01/how-to-control-1/" />
    <id>tag:thousandrobots.com,2006:/blog//1.5192</id>

    <published>2006-01-08T00:54:42Z</published>
    <updated>2006-04-12T18:22:37Z</updated>

    <summary> Summary This post describes how to interact with and control iTunes from any Microsoft Office application in Windows. Specifically, it shows how to: Create an Excel spreadsheet that lists all the tracks in your iTunes library, organized by playlist...</summary>
    <author>
        <name>ADM</name>
        
    </author>
    
        <category term="How To" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Software" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://thousandrobots.com/blog/">
        <![CDATA[<p class="postimage">
<img src="/blog/files/itunes/excel.jpg" alt="itunes in excel" />
</p>
<h3>Summary</h3>
<p>
This post describes how to interact with and control iTunes from any Microsoft Office application in Windows. Specifically, it shows how to:
</p>
<ul>
<li>Create an Excel spreadsheet that lists all the tracks in your iTunes library, organized by playlist</li>
<li>Use an Access database to update the mp3 ID tags of your songs in iTunes</li>
<li>Create a Microsoft Word document that lists all your iTunes tracks info in a table</li>
<li>Control iTunes playback from any Office application</li>
</ul>

<h3>Downloads</h3>
<p>
If you don't want to read the boring explanation about how to do these things, and you just want to download the files that already do them, here you go:
</p>
<ul>
<li><a href="/blog/files/itunes/itunes.xls">Excel spreadsheet</a> that loads your iTunes library info and lets you play any selected song</li>
<li><a href="/blog/files/itunes/itunes.mdb">Access database</a> that lets you browse your collection, update tags, and control playback</li>
<li><a href="/blog/files/itunes/itunes.doc">Word document</a> that displays all your iTunes tracks in a table</li>
</ul>
<p>
To use the Word and Excel files, run the macros in the Tools:Macro menu. Note that you will probably get all kinds of warnings about macro security and so on when you open the files, so you'll have to figure out how you want to handle that. Or you can also just <a href="/blog/files/itunes/">get the source code from these text files</a>, but you'll need to know how to connect that code to macros, etc. Please also note that these files are offered primarily as tutorials, not as complete applications, so they are likely to be buggy and not fail gracefully. Also, it's probably helpful to open iTunes before opening any of these documents. You can file bug reports in the comments, and I'll try to fix them when I'm able.
</p>

<h3>Technical Background</h3>
<p>
Many Windows applications, including iTunes, provide "libraries" of functionalities to other applications. Certains kinds of these libraries are called &quot;<a href="http://www.microsoft.com/technet/scriptcenter/guide/sas_vbs_wcmr.mspx">COM objects</a>&quot;, and they tend to be relatively easy to work with. Fortunately, Apple provides one of these for iTunes, and Visual Basic for Applications (VBA), the scripting language provided with Microsoft Office, can make use it. Using VBA, you can tap into the iTunes COM, and manipulate iTunes objects like playlists, tracks, and even the playback functionality. This post describes how to do so.
</p>
<h3>
Getting Started
</h3>
<h4>
Interacting with the iTunes Library
</h4>
<p>
Let's start by connecting a Word document to iTunes, so you can output a list of all the songs in your iTunes library to a Word document.
</p>
<ol>
<li>Open iTunes.</li>
<li>Open Word.</li>
<li>From the Tools menu, select Macro, then Macros.</li>
<li>Type the name of the macro you want to create ("Show_iTunes_Library" might be a good name), and click Create. A VBA editing window will appear. This is where you will type the code that will make up your macro.</li>
<li>Before you can make VBA do anything with iTunes, you need to tell it where to find the library of iTunes functions it can use. From the Tools menu, select References... Go through the list until you find "iTunes 1.2 Type Library", check it, and click OK.</li>
<li>Back in the VBA editing window, paste this text in between the first and last lines of your subroutine:
<pre><code>
Dim iTunes As iTunesApp
Dim tr As IITTrack

Set iTunes = New iTunesApp

For Each tr In iTunes.LibraryPlaylist.tracks
    ActiveDocument.Range.InsertAfter (tr.Name &amp; vbCrLf)
Next

Set iTunes = Nothing
</code></pre>
</li>
<li>Let's take another look at that code and see what it all does:
<pre><code>
'declare an object variable for the iTunes application and an iTunes "track" (song)
Dim iTunes As iTunesApp
Dim tr As IITTrack

'"instantiate" the class, i.e., prepare it for use.
Set iTunes = New iTunesApp

'go through each track in the LibraryPlaylist
For Each tr In iTunes.LibraryPlaylist.tracks
    'in the active document, insert the track's name (i.e., song title) 
    'and a new line (carriage return/line feed)
    ActiveDocument.Range.InsertAfter (tr.Name &amp; vbCrLf)
Next

'reset the iTunes object to free up the memory used in this code
set iTunes = Nothing</code></pre>
</li>
<li>
Back in your Macros dialog box, click the name of the macro you just created and run it. It should output all the track info in your library to the active document in Word. (There is code in the Word document above that shows how to convert this data into a table automatically.)
</li>
</ol>
<p>
This is just a basic example to show how to iterate your iTunes song library in VBA. If you wanted to have more info about each track appear, you can change the <code>tr.Name</code> part to include things like tr.Artist, tr.Album, tr.PlayedDate, etc. The VBA programming environment should display all the properties available to you as you start typing them. For example, if you declare <code>tr</code> as an iTunes track object, when you type <code>tr.</code>, all the available properties and actions (aka "methods") will appear in a drop-down selection box text to the variable name.
</p>
<h4>Controlling iTunes Playback</h4>
<p>
Similarly, to make the iTunes application itself take certain actions, you can do thing like <code>iTunes.Play</code> or <code>iTunes.Pause</code>, assuming your code has an iTunesApp object called <code>iTunes</code>. The names of the available actions ("methods") will appear when you type the name of the object variable followed by a period.
</p>
<p>For example, we can make a simple form in Microsoft Access that will control iTunes playback. This will probably go more smoothly if you've had a little experience designing forms in Access.</p>
<ol>
<li>Open iTunes.</li>
<li>Open Microsoft Access,</li>
<li>In the database window, choose Forms, and create a new form using Design View.</li>
<li>Add two buttons to the form. Name one cmdPlay and one cmdPause.</li>
<li>Set the captions to "Play" and "Pause" accordingly.</li>
<li>In the properties for cmdPlay, go to the Events tab, and in the On Click property, click "..." to create a new subroutine that will run when the button is clicked.</li>
<li>When the VBA window opens, set your references to the iTunes 1.2 Type Library as described above.</li>
<li>In the subroutine for cmdPlay_Click, enter this code:
<pre><code>
     Dim iTunes As iTunesApp
     Set iTunes = New iTunesApp
     iTunes.Play
     Set iTunes = Nothing
</code></pre>
</li>
<li>Go back to your form, and in the Click event for cmdPause, create a new subroutine that looks like this:
<pre>
<code>
Private Sub cmdPause_Click()
      Dim iTunes As iTunesApp
      Set iTunes = New iTunesApp
      iTunes.Pause
      Set iTunes = Nothing
End Sub
</code>
</pre>
</li>
<li>Open your form in Form view, and click the Play button. It should work.</li>
</ol>
<p>
If you want more information on all the iTunes objects, properties, and methods available to you, check out Apple's <a href="http://developer.apple.com/sdk/itunescomsdk.html">iTunes Software Development Kit for Windows</a>. You can pretty much ignore all of it except for the help file (iTunesCOM.chm) which, in a somewhat arcane manner, describes each of the classes (objects) and their properties and methods. Unfortunately, the help file is heavy on specification and light on examples, but using the examples and downloadable files I provided above, you should be able to figure it out with a bit of those critical thinking skills you picked up when you were younger.
</p>
<h3>Next Steps</h3>
<p>
Once you've figured out how to iterate through the tracks in your library, you are pretty much only limited by your knowledge of how VBA works in each of the Microsoft Office applications. If you know how to use VBA to create new documents, or worksheets, or slides, or address book contacts, or whatever, it's fairly simple to manipulate an iTunes library, playlist, or track to do whatever you want with the Office application of your choice. For example, the downloadable Excel spreadsheet offered above loops through all your playlists, creates a worksheet for each one, and adds the tracks from each playlist to the appropriate spreadsheet, along with the last played date and the play count. It will also play a track when you click on a track name and run the "play track" macro. The Access database provided above shows you track info for the currently playing song, allows you to jump to any song you type in, and lets you update the mp3 tags for the songs in your iTunes Library. The Word document enters all the tracks in your iTunes library into a table. Examine the source code to come up with your own projects, and have fun integrating Microsoft Office with iTunes.
</p>]]>
        
    </content>
</entry>

</feed>
