Wednesday, July 17, 2013

OSX Shuttle app running Apple Script

Here is a quick script to re-index the using the


Save this as speedmail.command.line.scpt

    Speed up by vacuuming the Envelope Index
    Code from:
    Originally by "pmbuko" with modifications by Romulo
    Updated by Brett Terpstra 2012 

    tell application "Mail" to quit
    set sizeBefore to do shell script "ls -lah ~/Library/Mail/V2/MailData | grep -E 'Envelope Index$' | awk {'print $5'}"
    do shell script "/usr/bin/sqlite3 ~/Library/Mail/V2/MailData/Envelope\\ Index vacuum"
    set sizeAfter to do shell script "ls -lah ~/Library/Mail/V2/MailData | grep -E 'Envelope Index$' | awk {'print $5'}"
    tell application "Terminal" to display dialog "Mail index before: " & sizeBefore & return & "Mail index after: " & sizeAfter & return & return & "Enjoy the new speed!"
    tell application "Mail" to activate

open up the and add this to the config ( note: you will need the path to where you save the speedmail.command.line.scpt file )

    "Apple Scripts": [
                "name": "Speed by Indexing",
                "cmd": "osascript ~/speedmail.command.line.scpt"

Happy Hacking