rock'n roll

Aug 1

libetpan moved to github

The libetpan source code repository moved to github!

libetpan used to be hosted on sourceforge since 2001. It provided a nice initial service and helped a lot. The repository used to be CVS [1]. I was tired writing an inefficient manual Changelog. There was no atomic history for diff. I decided to move to something a modern and jumped to git [2] (I missed the subversion step).

github [3] provides a git repository hosting, a faster service and a modern website. Then, libetpan moved here [4].

Goodbye dear old CVS and welcome to git!

[1] http://en.wikipedia.org/wiki/Concurrent_Versions_System

[2] http://en.wikipedia.org/wiki/Git_(software)

[3] http://github.com

[4] https://github.com/dinhviethoa/libetpan


Jun 3

iOS-style scrollbars for NSScrollView

Sparrow implements iOS-style scrollbars.

Here’s how you can do the same in your app:

You have to subclass NSScrollView. In method -tile, you have to set the position of the contentView so that scroller and content of scrollview overlaps. Then, set this as the class of the scrollview in interface builder.

NSScroller also has to be subclassed to get the behavior of iOS scrollbars. Then, set this as the class of the scrollers in interface builder.

This is how you can get the nice scrollbars you can find in Sparrow.

In the following file, you’ll find the implementation of MMScroller.

custom-scroller-b.zip


Jun 1

May 31

May 29

AppleScript with Sparrow

Currently, Sparrow only supports sending emails using AppleScript. Other scripting features will be added in further versions.

Here, how you can send an email with Sparrow using AppleScript:


tell application "Sparrow"
    activate
    set theMessage to make new outgoing message with properties {subject:"meeting at 4:00", content:"We'll be 4 to discuss about the future of our life."}
    tell theMessage
         make new to recipient at end of to recipients with properties {name:"John Doe", address:"john@gmail.com"}
         make new to recipient at end of cc recipients with properties {name:"Sonia Jones", address:"sonia@gmail.com"}
         sendmessage
    end tell
end tell

If you want to review the email before you send it:


tell application "Sparrow"
    activate
    set theMessage to make new outgoing message with properties {subject:"meeting at 4:00", content:"We'll be 4 to discuss about the future of our life."}
    tell theMessage
         make new to recipient at end of to recipients with properties {name:"John Doe", address:"john@gmail.com"}
         make new to recipient at end of cc recipients with properties {name:"Sonia Jones", address:"sonia@gmail.com"}
         compose
    end tell
end tell

If you want to add an attachment, here how you can do that:


tell application "Sparrow"
    activate
    set filename:attachmentfilename to (POSIX file "/path/to/filename") as string
    set theMessage to make new outgoing message with properties {subject:"meeting at 4:00", content:"We'll be 4 to discuss about the future of our life."}
    tell theMessage
         make new to recipient at end of to recipients with properties {name:"John Doe", address:"john@gmail.com"}
         make new to recipient at end of cc recipients with properties {name:"Sonia Jones", address:"sonia@gmail.com"}
         make new mail attachment with properties {filename:attachmentfilename as alias}
         sendmessage
    end tell
end tell