With this tip, if you send a mail through the Gmail web interface, it will appear in your sent folder in Apple Mail, when you next check mail. Built into the POP/SMTP interface, it already works the other way around. When you send a message through Gmail's SMTP server, the message is automatically added to your sent folder.
The only addition to the script was to add the condition:
- Account <gmail account name>
[via atmaspheric bookmarks]