Musings from Mars Banner Image
For Software Addicts: Yes!MaybeNah!
Articles in

Articles in "Applescript"

April 18th, 2007

Apple Mail Slowing Down? VacuumMail Can Probably Help

Originally published 3/9/07, updated 3/26/07:
VacuumMail now comes with a full installer package, which puts VacuumMail in your Utilities folder, the Launch Agent in your Library (makes the LaunchAgents folder if you don’t have one yet), and also optionally includes Peter Borg’s handy Lingon software for customizing your Launch Agent. No other changes are made to VacuumMail itself at this time. I’ve updated the link, though, to point to the new installer download.
VacuumMail Icon

A lively discussion and exchange of information occurred recently on Hawk Wings, the blog site mostly devoted to news and resources for users of Apple’s terrific Mail program. A colleague at work sent me a message on Tuesday, excited when word on Hawk Wings started circulating about a “vacuum” process available for SQLite databases that appeared to dramatically speed up Apple Mail. He had tried the recommended vacuuming and definitely noticed peppier Mail performance. One thing led to another, and before I knew it, I’d become engrossed in developing and polishing up an AppleScript utility to automate a periodic vacuuming of my Mail, which I’m of course dubbing VacuumMail.

As the Hawk Wings discussion unfolded, we learned that Mail maintains an SQLite database called “Envelope Index” in your ~/Library/Mail folder, which gradually grows as the number of emails in your mailbox does. Natively, Mail performs no optimizations on this critical database, which contains pointers to all of your mail that become fragmented and somewhat disorganized over time. At the office, my Envelope Index file was over 100mb, and at home it’s about 30mb. SQLite offers a “vacuum” Hawk Wings Blog Headercommand that rewrites the Envelope Index, optimizing and reorganizing it for faster access. It sounds a bit like what happens when Mac OS X defragments your hard drive periodically.

SQLite IconAt first, news of this function took the form of a shell command you can run in Terminal. It was quite interesting and exciting to see how the Mac users reading of this learned more about it as information was shared, and the command itself became more concise and precise as the day went on. Other users discovered that SQLite offers an “autovacuum” process that can do vacuuming without prompting, and I’m sure that’s a great thing as well. However, we also learned that vacuuming is a more robust and thorough optimizing of the file, since it actually analyzes and rewrites the whole thing, whereas autovacuuming acts only on a certain recent portion of mail pointers. The basic Terminal command turns out to be:

sqlite3 ~/Library/Mail/Envelope\ Index vacuum;

Full article

June 12th, 2006

Tell Me One Thing You Can Do With a Mac that I Can’t Do With Windows! (Part 3)

3. Use Real Productivity Applications To Get Work Done Faster, Easier

Automator Rides on ApplescriptAs inventors of new tools have done throughout human history, the visionaries who designed and built the first personal computers saw them as tools that would provide an immense boost to human productivity. And they weren’t just thinking about business productivity, folks. They were also thinking of personal productivity: Getting more things done faster so we’d have more leisure time.

Today, in our Microsoft-Windows dominated world, we use the term “productivity application” to refer to Microsoft Office, and we think of the personal computer as a business tool. (Quick: Do a Google search for that term–”productivity application”–and see what you get.) But has Microsoft Office provided us with more leisure time? Of course not. Microsoft Office is a business tool that replaced prior, non-electronic tools like the typewriter and pencil. If it has enhanced productivity at all (and that is arguable), the productivity gain has come in the form of more output per worker… not more leisure time for the individual. In any case, whatever productivity impact Microsoft Office and its ilk had on the business world was completed many years ago. Yet even for businesses, productivity didn’t stop with improving our ability to prepare reports and memos, or compile numbers in spreadsheets, or do overlays for a presentation in PowerPoint.

Productivity goes up whenever you can suddenly do a task in less time than before, either at home or at work. Since its beginnings with the original Apple computer, Apple has appeared to be pursuing a vision that steadily expands the personal computer’s potential to save you time… to do complicated things simpler. Apple’s operating system recognizes that this kind of productivity gain begins with the simplest interface to the computer: Finding things, opening applications, printing, opening documents, organizing information, and the like. As a result of this vision, Mac OS X has two built-in features that are simply lacking in Windows, and they enable “productivity” applications that are truly the envy of the Windows world:

Applescript and Application Services.

Full article