Posts Tagged ‘cocoa’

Leopard Mail’s clever HTML formatting

Wednesday, November 21st, 2007

A poster on macOSXHints points out how much smarter Leopard Mail is at handling content from the web which is pasted into its messages from web browsers.

For example, say you want to share someone’s overall top artists from Last.fm:

Lastfmwebsite

Block the content you want to send, and then drag it to a message in Mail.app, and behold:

Lastfmdraggedto Mailapp

Mail does a pretty good job of preserving the HTML formatting, even keeping the links and tool tips alive. It even provides a “widget-like” black boundary and cross for quick removal of the HTML block if you change your mind about sending it.

There are two things to note here. First, this works much better if the message is set to Rich Text Format. I live in a Plain Text world, so didn’t notice this at first. But perhaps only fuddy-duddies like me think it is more polite to send a link to the page.

Secondly, it works even better if you apply the “quicker text dragging” hack. Of course, this speeds life up all across Mac OS X, but also in this case.

Cocoa-based apps (Mail.app, Safari, etc) require by default that you hold your mouse down over the selected text for a second before dragging.

You can reduce the built-in delay with a simple Terminal hack. Open Terminal and type (exactly):

defaults write -g NSDragAndDropTextDelay -int 100

This will reduce the delay to a tenth of a second in all your Cocoa-based apps (‘-g’ stands for ‘global’).

It modifies a string in the .GlobalPreferences.plist file in your ~/Library/Preferences folder:

Nsdragand Drop

You could edit it manually in Plist Editor, as seen here, if you have an aversion to the Terminal, although you will need to use an app like Leopard Cache Cleaner to reveal Leopard’s “hidden files” first.

You will, of course, need to restart the apps for the change to take effect.mail.app, apple mail, productivity, safari, cocoa, text, html, rich text formatting, tips

Tags: , , , , , , , ,

Using TextMate to edit emails in Mail.app

Wednesday, April 26th, 2006

textmate100pxThe text editor TextMate comes bundled with an “Edit in TextMate” input manager which allows you to call Textmate as an external editor in Cocoa apps.

If you select the Install “Edit in TextMate”… action located in your TextMate bundle (using the gear menu in the status bar), you will get a full explanation and a button that creates the required symbolic link for you.

Then, when you want to write a reply or compose a new message in Mail.app, just hit the keyboard shortcut and get to work:

textmateeditor

When you are done, Command-S saves your work and inserts it in the message:

mailmessage

I have also found this useful when working in other apps. For example, if you are editing a 37Signals Writeboard , Command-Shift-S offers you a quick way to save your work off as a text file on your hard drive.

UPDATE: The TextMate people picked up this post on their own blog and offer some extra nifty tips on how to get the most out of TextMate as an external editor in Mail.

[From the TextMate mailing list and Manual ]textmate, mail.app, apple mail, cocoa, external editor, writeboard, tips

Tags: , , , , , ,