5 Top Tips For TextEdit [OS X Tips]

By

wordcount

All Macs come with a powerful word processor in the form of TextEdit. Here are five tips to let you get the most from it and maybe even avoid the need to splash out on Microsoft Word or iWork Pages.

This is yet another extract from Mac Kung Fu, a new book containing over 300 tips, tricks, hints and hacks for OS X Lion.

1. Word Count

A word count feature can be added to TextEdit using a little AppleScript, as follows.

Start AppleScript Editor, which you’ll find in the Utilities folder within the Applications view of Finder.

Copy and paste the following code into the main editing area of AppleScript Editor:

tell application "TextEdit"
set wc to count words of document 1
if wc is equal to 1 then
set txt to " word."
else
set txt to " words."
end if
set result to (wc as string) & txt
display dialog result with title "Word Count" buttons {"OK"} default button "OK"
end tell

Click the Compile button on the toolbar to check the code. If you get an error reported, check to ensure everything has been copied across correctly.

Click File->Save As and, in the Save As dialog box, hit Shift+Command+G , then type ~/Library/Scripts/, then hit the Go button. (Note: The Scripts folder might not exist. If so, open a Terminal window (Finder->Applications->Utilities->Terminal) and type mkdir ~/Library/Scripts to create it. Then repeat this step.)

Give the script the filename Word Count, then click the Save button.

Ensuring the AppleScript Editor program window is still active, click the program’s menu, then select the Preferences entry. In the dialog box that appears, ensure the General tab is selected and put a check next to the Show Script Menu in Menu Bar heading. This will add a new icon to the top right of the screen.

Quit AppleScript Editor. Then, to perform a word count on any open document in TextEdit, ensure the document window is foremost and click the new Scripts icon at the top right of the screen. Click the Word Count entry, which will probably be at the bottom of the list. The number of words will appear in a pop-up dialog box.

2. Search better

If you search for a word or phrase in TextEdit, you’ll see that the document view is dimmed and any instances of the search term are picked out in stark white. Additionally, you can click the left and right arrow buttons in the Find toolbar to move a yellow “blob” highlight through the document that shows instances of the search term.

A quick trick can turn off TextEdit's "blob" search highlighting that can obscure results

The problem is that the yellow “blob” expands beyond the boundaries of the word or phrase and covers letters to the left and right, which can make it difficult to see whether this particular instance of the found search term is the one you’re looking for.

The solution is to click anywhere within the document. This will deactivate the screen dimming. The search toolbar won’t disappear, and if you keep using the left and right arrows to find the search term, the yellow blob will contract to a simple highlighting of the word or phrase within a second or two of finding it. It’s a subtle but useful difference.

3. Go to a particular line

There’s a hidden keyboard shortcut within TextEdit that lets you jump straight to a particular line number. This can be useful for programmers, even though there is no option within TextEdit to actually display line numbers! To jump to a particular line, just hit Command+L , then type the number in question.

4. Spellcheck foreign languages

This is less of a tip and more of an observation, although it’s worth knowing. If you start typing in a non-English language, TextEdit will automatically switch its spellcheck dictionary to that language. Start typing in German, for example, and it will spot any errors in the German words you type. Right-clicking a misspelled word underlined in red will bring up a list of suggested German language corrections.

Resume typing in English, however, and TextEdit will again realize and switch the dictionary for that particular part of the document to English. Pretty cool!

5. Automatically create web or email links

A hidden feature in TextEdit will automatically turn web and email addresses into hyperlinks that, when subsequently clicked, will open the link in the default web browser or email client (this also works if the file is saved as an Office-compatible document and opened by a Windows user).

You can have TextEdit automatically turn web addresses into actual clickable links

It’s always been possible to insert a link by highlighting any text and clicking Edit->Add Link, but this new method will create links automatically as soon as you type them.

To activate the feature, click Preferences on the application menu, and in the bottom of the dialog box that appears, put a check in the Smart Links box. Close the dialog box and then close and restart TextEdit for the changes to take effect.

 

 

Newsletters

Daily round-ups or a weekly refresher, straight from Cult of Mac to your inbox.

  • The Weekender

    The week's best Apple news, reviews and how-tos from Cult of Mac, every Saturday morning. Our readers say: "Thank you guys for always posting cool stuff" -- Vaughn Nevins. "Very informative" -- Kenly Xavier.