Another reason you should learn to code: Python for Excel

Anyone who has used Microsoft Excel since 1993 has likely dabbled at least once with VBA, or Visual Basic for Applications. Now, a pair of MIT students have created an plug-in alternative to VBA called IronSpread, which uses the cross-platform Python scripting language.

Simplify Your Workflow With Dropzone

Dropzone Icon

The real power of OS X (s aapl) 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 third-party application designed to further simplify your Mac experience, fits into this group perfectly and naturally.

It’s Like an Intern for Your Dock

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.

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. Read More about Simplify Your Workflow With Dropzone

Scripting iWork: Numbers and Yahoo! Finance

numbers-iconWhen iWork ’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 — especially with Numbers ’08 — and lack of scripting. Apple’s new iWork ’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.

This article will focus on showing the scriptability of Numbers by writing a very small script to retrieve data from Yahoo! (s YHOO) Finance and put it into a custom table.
Read More about Scripting iWork: Numbers and Yahoo! Finance

Hidden Gems In Leopard: OpenSnoop

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 screen 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.
OS X changed all that, since Apple managed to make Unix look very 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’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’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).
The first stop is a little utility called opensnoop. Leopard ships with something called DTrace 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 – like opensnoop – 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 opensnoop 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 opensnoop.
If you can get to a terminal prompt, the simplest way to see what this utility does is to just type:

sudo opensnoop 

Non-Terminal folks can just run the application from the OpenSnoop App Archive (354KB ZIP file). (Either way, you’ll be asked to enter your password since opensnoop requires higher-level privileges to run.)
Output will look something like the following, though your listing contents should be very different:

UID    PID COMM            FD PATH 
501    286 SystemUIServer  17 /System/Library/CoreServices/Menu Extras/
501    218 Finder          11 /.vol/234881026/571978
501    286 SystemUIServer  17 /System/Library/CoreServices/Menu Extras/
501    286 SystemUIServer  17 /System/Library/CoreServices/Menu Extras/
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/

For each line:

  • UID is the numerical ID of the owner of program that has the file opened.
  • PID is the process ID of the program that has the file open
  • COMM is the actual name of the process (this is something we care about)
  • FD is the numerical file descriptor (ID) of the file being accessed
  • PATH is the full OS X path to the file being accessed (this is also something we care about)

The sample output is what occurred when I switched to/from Spaces 1 & 3. Just that simple case shows how interesting opensnoop can be since we see that the SystemUIServer and WindowServer were both invoked when I worked just a little bit with Spaces and that SpacesBackground.pdf was loaded from one of the Spaces app bundles.
While this is useful in-and-of itself, we can use opensnoop for more targeted and detailed inspection. The following command:

sudo opensnoop -avgn Safari

(Non-Terminal users can run the from the archive)
Produces the following output when I tell it to go to

TIME           STRTIME                UID    PID  FD ERR PATH                 ARGS
8071248908 2008 Jan 10 21:33:13 501 1153 17 0 /Users/bob/Library/Caches/ Safari