<?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:go='http://ns.gigaom.com/'
xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>GigaOM &#187; Apple</title>
	<atom:link href="http://gigaom.com/apple/tag/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://gigaom.com</link>
	<description></description>
	<lastBuildDate>Fri, 10 Feb 2012 12:35:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='gigaom.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/0db8f6557d022075dbbf010c54d46d93?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>GigaOM &#187; Apple</title>
		<link>http://gigaom.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://gigaom.com/osd.xml" title="GigaOM" />
	<atom:link rel='hub' href='http://gigaom.com/?pushpress=hub'/>
		<item>
		<title>Simplify Your Workflow With Dropzone</title>
		<link>http://gigaom.com/apple/simplify-your-workflow-with-dropzone/</link>
		<comments>http://gigaom.com/apple/simplify-your-workflow-with-dropzone/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 22:30:31 +0000</pubDate>
		<dc:creator>Christopher Ryan</dc:creator>
				<category><![CDATA[Apps]]></category>
		<category><![CDATA[CNN Big Tech]]></category>
		<category><![CDATA[CNN Search]]></category>
		<category><![CDATA[NYT Company News]]></category>
		<category><![CDATA[NYT Enterprise]]></category>
		<category><![CDATA[NYT Internet]]></category>
		<category><![CDATA[Software Reviews]]></category>
		<category><![CDATA[SYN Feature Enterprise]]></category>
		<category><![CDATA[SYN Straight News]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[aptonic]]></category>
		<category><![CDATA[automator]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[dropzone]]></category>
		<category><![CDATA[finder]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[opera 10.5]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[stacks]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://theappleblog.com/?p=28206</guid>
		<description><![CDATA[The real power of OS X lies in all of the hidden gems beneath what you see at first glance. Technologies like Expose, Spaces, Stacks, Spotlight and others help users tap the power of their Mac, while keeping the experience sleek and elegant. Aptonic’s Dropzone, a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gigaom.com&amp;blog=14960843&amp;post=173056&amp;subd=gigaom2&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img  title="Dropzone Icon" src="http://gigapple.files.wordpress.com/2009/07/dropzoneicon.jpg?w=200&#038;h=200" alt="Dropzone Icon" width="200" height="200" class=" alignleft" /></p>
<p class="excerpt">The real power of OS X lies in all of the hidden gems beneath what you see at first glance. Technologies like Expose, Spaces, Stacks, Spotlight and others help users tap the power of their Mac, while keeping the experience sleek and elegant. Aptonic’s <a href="http://aptonic.com">Dropzone</a>, a third-party application designed to further simplify your Mac experience, fits into this group perfectly and naturally.</p>
<h3>It&#8217;s Like an Intern for Your Dock</h3>
<p>Dropzone is an application that resides in your Dock like any other app. The power of Dropzone comes into play when you begin dragging files onto its icon. Similar to the appearance of a Stack, Dropzone will expand giving you options of what to do with the file or files you’ve selected. Think of it like Automator for your Dock.</p>
<p>For example, if I have a handful of files selected, and drag them onto my Dropzone icon, I am presented with a series of choices, one of which is “Zip files and email.” As simple as it sounds, dragging the files onto this icon zips the files automatically and attaches them to a new email message inside of Mail. Gone are the days of right-clicking to compress the files, attaching that to an email and then deleting the zip file when I’m done. <span id="more-173056"></span></p>
<p><img  title="Dropzone UI" src="http://gigapple.files.wordpress.com/2009/07/dropzoneui.jpg?w=540&#038;h=350" alt="Dropzone UI" width="540" height="350" class=" alignleft" /></p>
<p>Another “destination” included is the ability to install applications quickly by dragging a DMG onto the “Install Application” destination. Behind the scenes, your Mac will mount the DMG file, locate the application inside, copy it to your Applications folder and launch it, unmount the DMG and move the DMG file to the trash.</p>
<p>Other destinations include quick access to uploading images to <a href="http://www.flickr.com">Flickr</a> (including copying the image URL to your clipboard when its done) or upload files to your FTP server. Want those files zipped before upload? No problem. Just hold down the option key as you drag the files onto the icon. It’s quick and simple and really does save time.</p>
<p>I’m the type of Mac user who likes to keep my Dock as simplified as possible, but I do enjoy the ability to be able to drag files onto an application icon and force the file to open in that application. Dropzone allows me to throw applications I use frequently inside of it and then I have the ability to do just that. Compared to attempting the same thing with a stack in Leopard, I only spawn Finder windows.</p>
<h3>Taking It Further</h3>
<p>Several optional downloads can extend the functionality of Dropzone. There are add-ons to allow you to start your screensaver, mount/unmount firewire drives, and set your computer to sleep, in addition to <a title="Aptonic Software - Dropzone" href="http://aptonic.com/extend.php">many others</a>. Dropzone even includes support for popular web services, including the ability to quickly share photos via <a href="http://www.twitpic.com">TwitPic</a>, shorten a dropped URL via the <a href="http://www.is.gd">Is.Gd</a> service (and copy it to the clipboard automatically), and quickly share photos and documents on <a href="http://www.posterous.com">Posterous</a>.</p>
<p>If you are comfortable programming ruby scripts, Dropzone also offers a <a href="http://aptonic.com/dropzone/documentation/">scripting API</a> to allow you to create your own “destinations” to further extend the application.</p>
<p>If you&#8217;d like to try out Dropzone, it&#8217;s currently available for Leopard or Snow Leopard users. Aptonic does provide a trial version of the software, and the cost is only $10 to purchase the full version. The trial does limit you to 15 days of use and up to five “destinations” at a time. I spoke with the developers at Aptonic and they informed me that updates through 1.0 will be freely available to users who register, but the $10 price is likely just an introductory price. Download the demo version <a href="http://aptonic.com/demo.php">here</a>.</p>
<p>I&#8217;ll be the first to admit, much like <a title="Quicksilver: The Guide" href="http://theappleblog.com/quicksilver-the-guide/">Quicksilver</a> or Spaces, once you get used to integrating this app, it really does save you time. If you have tried out Dropzone, let me know your thoughts in the comments below!</p>
<p><strong>Related research and analysis from GigaOM Pro:</strong><br />Subscriber content. <a href="http://pro.gigaom.com/?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=173056+simplify-your-workflow-with-dropzone&utm_content=limeology">Sign up for a free trial</a>.</p><ul><li><a href="http://pro.gigaom.com/2010/11/report-the-connected-tv-marketplace/?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=173056+simplify-your-workflow-with-dropzone&utm_content=limeology">Report: The Connected TV&nbsp;Marketplace</a></li><li><a href="http://pro.gigaom.com/2010/09/how-to-market-your-iphone-app-a-developers-guide/?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=173056+simplify-your-workflow-with-dropzone&utm_content=limeology">How to Market Your iPhone App: A Developer&#8217;s&nbsp;Guide</a></li><li><a href="?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=173056+simplify-your-workflow-with-dropzone&utm_content=limeology"></a></li></ul><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gigaom.com&amp;blog=14960843&amp;post=173056&amp;subd=gigaom2&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gigaom.com/apple/simplify-your-workflow-with-dropzone/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/832459ff6ff50bbfb3a2b901927c1448?s=96&#38;d=retro&#38;r=PG" medium="image">
			<media:title type="html">limeology</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2009/07/dropzoneicon.jpg" medium="image">
			<media:title type="html">Dropzone Icon</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2009/07/dropzoneui.jpg" medium="image">
			<media:title type="html">Dropzone UI</media:title>
		</media:content>
	</item>
		<item>
		<title>Scripting iWork: Numbers and Yahoo! Finance</title>
		<link>http://gigaom.com/apple/scripting-iwork-numbers-and-yahoo-finance/</link>
		<comments>http://gigaom.com/apple/scripting-iwork-numbers-and-yahoo-finance/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 19:00:39 +0000</pubDate>
		<dc:creator>Bob Rudis</dc:creator>
				<category><![CDATA[CNN Big Tech]]></category>
		<category><![CDATA[Commentary]]></category>
		<category><![CDATA[NYT Company News]]></category>
		<category><![CDATA[SYN Feature Enterprise]]></category>
		<category><![CDATA[Walkthroughs]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[iWork]]></category>
		<category><![CDATA[Numbers]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://theappleblog.com/?p=16643</guid>
		<description><![CDATA[When iWork &#8217;08 was released it felt like a half-implemented suite for a whole host of reasons: lack of interoperability between the applications, very basic functionality, performance issues &#8212; especially with Numbers &#8217;08 &#8212; and lack of scripting. Apple&#8217;s new iWork &#8217;09 suite has addressed many [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gigaom.com&amp;blog=14960843&amp;post=172324&amp;subd=gigaom2&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img  title="numbers-icon" src="http://gigapple.files.wordpress.com/2009/02/numbers-icon.png?w=128&#038;h=128" alt="numbers-icon" width="128" height="128" class=" alignleft" />When iWork &#8217;08 was released it felt like a half-implemented suite for a whole host of reasons: lack of interoperability between the applications, very basic functionality, performance issues &#8212; especially with Numbers &#8217;08 &#8212; and lack of scripting. Apple&#8217;s new iWork &#8217;09 suite has addressed many of those issues, and the one feature that truly stands out (for me) is the ability to bend the applications to your will via scripting.</p>
<p>This article will focus on showing the scriptability of Numbers by writing a very small script to retrieve data from Yahoo! Finance and put it into a custom table.<br />
<span id="more-172324"></span></p>
<h3>Numbers Scripting Definitions</h3>
<p>To get an idea of what you have at your disposal, fire up <strong>/Applications/AppleScript/Script Editor</strong> and select <strong>File-&gt;Open Dictionary…</strong> and choose <strong>Numbers</strong> from the dialog:</p>
<p><img  title="open-dictionary_02" src="http://gigapple.files.wordpress.com/2009/02/open-dictionary_02.png?w=397&#038;h=255" alt="open-dictionary_02" width="397" height="255" class=" alignleft" /></p>
<p>You will should see a window that looks a bit like this:</p>
<p style="text-align: center;"><img  title="numbers1_02" src="http://gigapple.files.wordpress.com/2009/02/numbers1_02.png?w=604" alt="numbers1_02" class=" alignleft" /></p>
<p>You should definitely take some time to peruse all the options available at your disposal but you will find that, while Apple has provided many ways to manipulate the contents of documents, sheets, tables, cells and rows, there is a distinct lack of functions related to charting/graphing. Perhaps an incremental update or Numbers X will correct this oversight.</p>
<h3>Directing the Data</h3>
<p>Yahoo! Finance has a very nice <a href="http://finance.yahoo.com/q/hp?s=AAPL">historical data</a> view for closing stock prices. Even with all of the enhancements, Numbers still lacks one of the nicest features of Excel: the ability to grab data from a URL. To remedy this, we can create an AppleScript that:</p>
<ul>
<li>lets us input the symbol of the stock we are interested in</li>
<li>fetch the data from Yahoo! Finance</li>
<li>and populate a new table in Numbers with this data</li>
</ul>
<p>Part&#8217;s one and two are  pretty straightforward AppleScript:</p>
<p><pre class="brush: csharp;">
set tempFile to ((path to temporary items) as string) & "yahoo-quote"

-- get company to display from the user
display dialog "Enter symbol:" default answer "AAPL"
set company to text returned of result

-- download the file
tell application "URL Access Scripting"
 set theURL to "http://ichart.finance.yahoo.com/table.csv?s=" & company & "&a=00&b=1&c=2008&g=d&ignore=.csv"
 download theURL to file tempFile
end tell
</pre></p>
<p>Here&#8217;s where it gets interesting. First, we tell Numbers (the script assumes the app is open with a document ready) to become active and make the most recent document the one we want to work in. We then read in the data from Yahoo! to determine how many rows we need and use the header line to determine how many columns we need and then make a new table with this information:</p>
<p><pre class="brush: csharp;">
tell application "Numbers"
	activate
	tell document (count of documents)
		tell sheet 1
			-- read in the file contents
			set quoteLines to paragraphs of (read file tempFile)
			set quoteValues to {}
			-- get number of rows for the table
			set nRows to length of quoteLines
			-- get number of columns for the table
			-- (grab header row first)
			set tempLine to item 1 of quoteLines
			-- we need to split the line with commas as delimeters
			set oldDelims to AppleScript's text item delimiters
			set AppleScript's text item delimiters to ","
			set headers to every text item of tempLine
			set nCols to length of headers
			-- make a new Numbers table that fits the # rows & cols in the CSV file
			make new table with properties {name:company, row count:nRows, column count:(nCols + 1)}
</pre></p>
<p>Finally, we loop through each line (row) and copy the data from each column to the correct cell, then we delete the temporary file we created at the beginning:</p>
<p><pre class="brush: csharp;">
tell table (count of tables) -- the one we just made is the last
				delete column 1 -- labels we don't need
				set nRow to 1
				repeat with aLine in quoteLines
					set cellValues to every text item of aLine
					set nCol to 1
					repeat with aCell in cellValues
						set value of cell nCol of row nRow to aCell
						set nCol to nCol + 1
					end repeat
					set nRow to nRow + 1
				end repeat
			end tell
			-- we need to put the delimeters back
			set AppleScript's text item delimiters to oldDelims
		end tell
	end tell
end tell
tell application "Finder" to delete file tempFile
</pre></p>
<p>When you run the script (<a href="http://a.theappleblog.com/files/yahoo-to-numbers.scpt.zip">download the source</a>), you will be able to watch Numbers create the new table and populate all of the cells.</p>
<p>This <em>particular</em> script duplicates a built-in functionality of Numbers: the ability to read CSV files. However, you could very easily modify it to use AppleScript to tweak the data or make a call out to a Python or Perl script to do even more substantial modifications then bring the information back in. The fundamental purpose of the script is to demonstrate just how easy it is to address cells and rows. Reading data is just as easy &#8212; <code>set v to value of cell x of row y</code> &#8212; and that opens up a whole host of possibilities, such as using an active Numbers sheet to send data to a web service via a global-hotkey-enabled AppleScript action.</p>
<p>Make sure to drop a note in the comments with how are you using the new scripting functionality in Apple&#8217;s latest iWork suite.</p>
<p><strong>Related research and analysis from GigaOM Pro:</strong><br />Subscriber content. <a href="http://pro.gigaom.com/?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=172324+scripting-iwork-numbers-and-yahoo-finance&utm_content=hrbrmstr">Sign up for a free trial</a>.</p><ul><li><a href="http://pro.gigaom.com/2011/03/why-ipad-2-will-lead-consumers-into-the-post-pc-era/?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=172324+scripting-iwork-numbers-and-yahoo-finance&utm_content=hrbrmstr">Why iPad 2 Will Lead Consumers Into the Post-PC&nbsp;Era</a></li><li><a href="http://pro.gigaom.com/2011/03/the-near-term-evolution-of-social-commerce/?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=172324+scripting-iwork-numbers-and-yahoo-finance&utm_content=hrbrmstr">The Near-Term Evolution of Social&nbsp;Commerce</a></li><li><a href="http://pro.gigaom.com/2011/02/content-farms-the-players-the-benefits-the-risks/?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=172324+scripting-iwork-numbers-and-yahoo-finance&utm_content=hrbrmstr">Content Farms: The Players, The Benefits, The&nbsp;Risks</a></li></ul><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gigaom.com&amp;blog=14960843&amp;post=172324&amp;subd=gigaom2&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gigaom.com/apple/scripting-iwork-numbers-and-yahoo-finance/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a08d08f6b541441fccf36bc6392a0784?s=96&#38;d=retro&#38;r=PG" medium="image">
			<media:title type="html">hrbrmstr</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2009/02/numbers-icon.png" medium="image">
			<media:title type="html">numbers-icon</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2009/02/open-dictionary_02.png" medium="image">
			<media:title type="html">open-dictionary_02</media:title>
		</media:content>

		<media:content url="http://gigapple.files.wordpress.com/2009/02/numbers1_02.png" medium="image">
			<media:title type="html">numbers1_02</media:title>
		</media:content>
	</item>
		<item>
		<title>Hidden Gems In Leopard: OpenSnoop</title>
		<link>http://gigaom.com/apple/hidden-gems-in-leopard-opensnoop/</link>
		<comments>http://gigaom.com/apple/hidden-gems-in-leopard-opensnoop/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 16:38:31 +0000</pubDate>
		<dc:creator>Bob Rudis</dc:creator>
				<category><![CDATA[Commentary]]></category>
		<category><![CDATA[Locations & Services]]></category>
		<category><![CDATA[Quickies]]></category>
		<category><![CDATA[dtrace]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://theappleblog.com/2008/01/14/hidden-gems-in-leopard-opensnoop/</guid>
		<description><![CDATA[I have a confession to make: I have not always been a Mac person. For the period of time between the retirement of System 9 and Panther (yes, it took Apple showing a real commitment to Unix for me to give them a shot again), I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gigaom.com&amp;blog=14960843&amp;post=171247&amp;subd=gigaom2&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have a confession to make: I have not always been a Mac person. For the period of time between the retirement of System 9 and Panther (yes, it took Apple showing a real commitment to Unix for me to give them a shot again), I abandoned our fine operating system for greener pastures, well, green <em>screen</em> at least. Work drove me into Windows (as it has for about 90% of the workers out there) but my real outlet was anything Linux, BSD or Solaris-related. There was nary a distro that did not cross my hard drive (virtual or otherwise) and I was very happy programming, scripting and living life on the command line, with an occasional, lingering trip into X11 when necessary.</p>
<p>OS X changed all that, since Apple managed to make Unix look <em>very</em> good while keeping all of the real power that lies beneath the GUI.Now, one may be able to argue the aesthetics of  Leopard (hey, Panic should be happy, it took Leopard to finally drive me into purchasing CandyBar), but none can dispute the gems that await those who dare to invoke the Terminal, and I&#8217;ll be taking the opportunity over some of the coming posts to dwell on the nuggets that bear a deeper look. For those that are not as comfortable with the more textual side of their systems, I&#8217;ll be making these trips as painless as possible (you may not need to delve into the Utilities folder to find the Terminal icon at all).</p>
<p>The first stop is a little utility called <a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/opensnoop.1m.html"><code>opensnoop</code></a>. Leopard ships with something called <a href="http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html">DTrace</a> that gives developers and administrators the ability to take a peek at what all running code is doing in a flexible and dynamic way. Giving DTrace the coverage it deserves is beyond a simple blog post, but there are some smaller utilities &#8211; like <code>opensnoop</code> &#8211; that take advantage of the power of DTrace, but on a more targeted scale which are worthy of a minor exposition.The main purpose of the <code>opensnoop</code> utility is to provide a report of file opens as they occur. Curious as to what really happens when Safari opens a web page? Want to see what files are accessed from that latest program you downloaded? You can find the answers with <code>opensnoop</code>.</p>
<p>If you can get to a terminal prompt, the simplest way to see what this utility does is to just type:</p>
<blockquote><p><code>sudo opensnoop</code> </p></blockquote>
<p>Non-Terminal folks can just run the <code>OpenSnoop.app</code> application from the <a href="http://theappleblog.com/wp-content/uploads/2008/01/opensnoop.zip" title="OpenSnoop App Archive">OpenSnoop App Archive</a> (354KB ZIP file). (Either way, you&#8217;ll be asked to enter your password since <code>opensnoop</code> requires higher-level privileges to run.)</p>
<p>Output will look something like the following, though your listing contents should be very different:</p>
<pre style="overflow-x: auto; overflow-y: auto; width: 500px; height: 200px">
UID    PID COMM            FD PATH 
501    286 SystemUIServer  17 /System/Library/CoreServices/Menu Extras/Spaces.menu/Contents/Resources/SpacesBackground.pdf
501    218 Finder          11 /.vol/234881026/571978
501    286 SystemUIServer  17 /System/Library/CoreServices/Menu Extras/Spaces.menu/Contents/Resources/SpacesBackground.pdf
501    286 SystemUIServer  17 /System/Library/CoreServices/Menu Extras/Spaces.menu/Contents/Resources/SpacesBackground.pdf
0      110 WindowServer     4 /var/log/windowserver.log 
0      110 WindowServer     4 /var/log/windowserver.log 
501    286 SystemUIServer  17 /System/Library/CoreServices/Menu Extras/Spaces.menu/Contents/Resources/SpacesBackground.pdf</pre>
<p>For each line:</p>
<ul>
<li><code>UID</code> is the numerical ID of the owner of program that has the file opened.</li>
<li><code>PID</code> is the process ID of the program that  has the file open</li>
<li><code>COMM</code> is the actual name of the process <strong>(this is something we care about)</strong></li>
<li><code>FD</code> is the numerical file descriptor (ID) of the file being accessed</li>
<li><code>PATH</code> is the full OS X path to the file being accessed <strong>(this is also something we care about)</strong></li>
</ul>
<p>The sample output is what occurred when I switched to/from Spaces 1 &amp; 3. Just that simple case shows how interesting <code>opensnoop</code> can be since we see that the <code>SystemUIServer</code>  and <code>WindowServer</code> were both invoked when I worked just a little bit with Spaces and that <code>SpacesBackground.pdf</code> was loaded from one of the Spaces app bundles.</p>
<p>While this is useful in-and-of itself, we can use <code>opensnoop</code> for more targeted and detailed inspection. The following command:</p>
<blockquote><p><code>sudo opensnoop -avgn Safari</code></p></blockquote>
<p>(Non-Terminal users can run the <code>SnoopSafari.app</code> from the archive)</p>
<p>Produces the following output when I tell it to go to <code>google.com</code>:</p>
<pre style="overflow-x: auto; overflow-y: auto; width: 500px; height: 200px">
TIME           STRTIME                UID    PID  FD ERR PATH                 ARGS
8071248908     2008 Jan 10 21:33:13   501   1153  17   0 /Users/bob/Library/Caches/com.apple.Safari/Cache.db-journal Safari 
8071249029     2008 Jan 10 21:33:13   501   1153  18   0 /Users/bob/Library/Caches/com.apple.Safari Safari 
8071249636     2008 Jan 10 21:33:13   501   1153  24   0 /var/tmp/etilqs_rjFUOz2TEh7AaoG Safari 
8075981916     2008 Jan 10 21:33:18   501   1153  18   0 /Users/bob/Library/Caches/Metadata/Safari/History/.tracked filenames.plist Safari 
8075982865     2008 Jan 10 21:33:18   501   1153  18   0 /Users/bob/Library/Caches/Metadata/Safari/History/http:%2F%2Fgoogle.com%2F.webhistory Safari 
8075983663     2008 Jan 10 21:33:18   501   1153  18   0 /Users/bob/Library/Caches/Metadata/Safari/History/http:%2F%2Fwww.google.com%2F.webhistory Safari 
8075984521     2008 Jan 10 21:33:18   501   1153  18   0 /Users/bob/Library/Caches/Metadata/Safari/History/.tracked filenames.plist Safari 
8075980917     2008 Jan 10 21:33:18   501   1153  18   0 /.vol/234881026/713654 Safari 
8077969298     2008 Jan 10 21:33:19   501   1153  18   0 /Users/bob/Library/Safari/.dat0481.441 Safari 
8077966383     2008 Jan 10 21:33:19   501   1153  18   0 /Users/bob/Library/Safari/.dat0481.440 Safari 
8080982146     2008 Jan 10 21:33:23   501   1153  18   0 /Users/bob/Library/Safari/lock/.dat0481.442 Safari 
8080983115     2008 Jan 10 21:33:23   501   1153  18   0 /Users/bob/Library/Safari/lock/details.plist Safari 
8081191826     2008 Jan 10 21:33:23   501   1153  18   0 /Users/bob/Library/Safari/lock/details.plist Safari 
8081192743     2008 Jan 10 21:33:23   501   1153  18   0 /Users/bob/Library/Safari/lock Safari 
8081193635     2008 Jan 10 21:33:23   501   1153  18   0 /Users/bob/Library/Safari/.de0481.443 Safari </pre>
<p>The extra fields are the Unix-coded time, the translated timestamp, the error code (if any) and the file being accessed. This is a more verbose listing, but we will not see any file data from application other than Safari. You can substitute &#8220;Adium&#8221; or &#8220;Finder&#8221;, etc for &#8220;Safari&#8221; on the command line and I&#8217;ve included <code>SnoopAdium.app</code>, <code>SnoopFinder.app</code> and <code>SnoopFirefox.app</code> within the archive.</p>
<p>Hopefully, you are beginning to see the power of this small utility.While there are many options for you to explore within <code>opensnoop</code>, one of the more interesting ones is the &#8220;<code>-x</code>&#8221; flag, which only displays the failed opens (I&#8217;ve included <code>SnoopFailed.app</code> in the archive as well). It&#8217;s always good to peek at what applications are looking for but cannot find, especially if you are having trouble with your system or a particular application.I&#8217;m working on a more generic GUI front-end to <code>opensnoop</code> and will let you know when I have something worth sharing.</p>
<p>These apps were all built with the extremely useful <a href="http://www.sveinbjorn.org/platypus">Platypus</a> tool (which is in my developer folder once again post-Leopard install). If there&#8217;s a particular &#8220;snoop&#8221; app you&#8217;d like me to whip up, drop a note in the comments and I&#8217;ll do my best to crank&#8217;em out (I&#8217;ll post the other apps either on my .Mac iDisk or my personal site).</p>
<p><strong>Related research and analysis from GigaOM Pro:</strong><br />Subscriber content. <a href="http://pro.gigaom.com/?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=171247+hidden-gems-in-leopard-opensnoop&utm_content=hrbrmstr">Sign up for a free trial</a>.</p><ul><li><a href="http://pro.gigaom.com/2010/07/green-it-overview-q2-2010/?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=171247+hidden-gems-in-leopard-opensnoop&utm_content=hrbrmstr">Green IT Overview, Q2&nbsp;2010</a></li><li><a href="?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=171247+hidden-gems-in-leopard-opensnoop&utm_content=hrbrmstr"></a></li><li><a href="http://pro.gigaom.com/2011/03/why-ipad-2-will-lead-consumers-into-the-post-pc-era/?utm_source=apple&utm_medium=editorial&utm_campaign=auto3&utm_term=171247+hidden-gems-in-leopard-opensnoop&utm_content=hrbrmstr">Why iPad 2 Will Lead Consumers Into the Post-PC&nbsp;Era</a></li></ul><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gigaom.com&amp;blog=14960843&amp;post=171247&amp;subd=gigaom2&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gigaom.com/apple/hidden-gems-in-leopard-opensnoop/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a08d08f6b541441fccf36bc6392a0784?s=96&#38;d=retro&#38;r=PG" medium="image">
			<media:title type="html">hrbrmstr</media:title>
		</media:content>
	</item>
	</channel>
</rss>
