Clean Up Text Using Summarize Service
Have you ever come across a selection of text you’d like to keep—for example, a how-to on a Web page or an article on your local paper’s site? You may have tried copying it and pasting it into TextEdit or Stickies, only to end up with the text and all its distracting formatting, links, and spacing. Here’s a quick and easy workaround.
If the program you’re using supports OS X’s Services feature (as is the case for most Apple apps, as well as The Omni Group’s products and Bare Bones’ BBEdit), you can use the Summarize service to clean up the text for easy saving. Start by selecting the text within the source application, and then choose application name : Services: Summarize.
A new window will open, and you’ll see a cleaned-up version of your text. Next, move the Summary Size slider to the 100% mark; this will force the service to show every word in your original selection. Then press Command-C to copy the text to the Clipboard (it’s already all selected by default), switch to your final destination (a Stickies note, a Word document, or whatever), and press Command-V to paste.
If the text isn’t in a Services-aware application, drop it into TextEdit as your first step. If you have TextEdit in Plain Text mode (go to TextEdit: Preferences), doing so will get rid of almost all the formatting. Using the Summarize service will then remove any remaining excess line breaks and other oddities.
Enter URLs Quickly in OmniWeb 5
Autocompletion of URLs can be a real time-saver in browsers. If you’ve visited CNN before, for instance, you’ll probably only have to type
cnbefore your browser figures out that you’re heading there again, and it will complete the URL for you. Most browsers complete starting from the front of the URL only, but The Omni Group’s OmniWeb 5 ($30) also autocompletes from the end of the URL. So if you often visit a deeply buried page on a large site (
www.example_bank.com/balances/checking/jun05, for instance), you can type only the end of the URL (
jun05), and OmniWeb will fill in the entire address for you.
Preview Multiple Fonts with Font Book and Exposé
Do you work with a large number of typefaces and often add new ones to your system? Do you wish you had an easy way to preview a number of them simultaneously without first installing them? You can preview a font without installing it by double-clicking on it in the Finder, or by dragging and dropping the font onto Font Book’s icon (either in the Dock or in the Applications folder). Drag and drop multiple fonts at the same time, and Font Book opens a new preview window for each one. Unfortunately, Font Book cascades these windows, so you can see only one at a time.
Using Exposé, though, you can easily review all the previewed fonts at one time. Just press F10, the Exposé Application Windows keystroke, and the windows will arrange themselves across your screen. As long as you haven’t opened more fonts than your monitor can fit, you’ll be able to see enough detail to determine which fonts you want (See screenshot). To install a font, just click on its window to make it come to the foreground, and then click on the Install button. Press F10 again, select the next font, and repeat.
Add the Latest Java Support to Mozilla Browsers
If you use a browser other than Safari or OmniWeb, you might find that there’s a slew of interesting Java-based Web apps you can’t see. For instance, the applets at Walter Fendt’s Java Applets on Physics won’t work in free Mozilla-based browsers such as Foxfire, Camino, or Mozilla.
Why? The Mozilla-based browsers don’t use the latest version of the Java Virtual Machine. (See macworld.com/0380 for the deeply technical explanation if you’re interested.) Thanks to the open-source nature of the Mozilla browsers, though, this problem has a solution.
Start by visiting the Java plug-in site. Download the latest available package by clicking on the file name below the Latest File Releases header. A new Web page will appear. Click on the first entry ( javaplugin ) in the Latest File Releases list. As of this writing, the file is called JavaEmbeddingPlugin0.9.0.zip.
After the download completes, quit your Mozilla-based browser and open the JavaEmbeddingPlugin folder. Open the Binaries folder inside, and then drag and drop the two files located there (JavaEmbeddingPlugin.bundle and MRJPlugin.plugin) into your Mac’s top-level Library/Internet Plug-Ins folder. You may have to create this folder if you haven’t installed Internet plug-ins before.
Before you can use the plug-in, you need to check one last thing. Its functionality depends on the order in which your plug-ins load: the MJRPlugin.plugin file must load before two Apple-provided files, Java Applet.plugin and Java Applet Plugin Enabler. To ensure that this is the case, view the Plug-Ins folder by date (choose View: As List, then click once on the Date Modified column header to order the files from newest to oldest). If MRJPlugin.plugin is listed above the other two files, you’re home free.
If it’s not, open Terminal, type
touch "/Library/Internet Plug-Ins/MRJPlugin .plugin", and press return. You’ve just changed the plug-in’s date stamp to the present date and time; it will now appear at the top of the list in the Finder. Launch your Mozilla-based browser again and load the physics site mentioned earlier. You’ll find that the applets now all work as expected.
Skip Clicking on Samples in the iTunes Music Store
Listening to 30-second song snippets at the iTunes Music Store is a great way to get acquainted with a new band. Just search for an artist’s songs and then click on each song in turn to get a sense for the artist’s sound. But all this clicking just to get an earful can be a pain.
The following AppleScript takes care of that problem. Open Script Editor (in Applications/Utilities), and type in the following code:
on idle tell application "iTunes" next track end tell return 29.5 end idle
Select File: Save, give your new script a name, and select Application from the File Format pop-up menu. Choose the Stay Open option. It doesn’t matter where you save the script; you just want to store it where you can get to it quickly. (Consider dragging it to the Dock, the sidebar, or the toolbar for truly fast access.)
Now visit the iTunes Music Store and search for something. In the results box, double-click on the first sample. Before the clip ends, switch to the Finder and launch your saved script. When you do, iTunes will jump to the next sample, play it for 29.5 seconds, and keep going until all samples have played.
Yes, you’ll miss the last 0.5 seconds of each one, but there’s a good reason this figure is set below 30 seconds. If you set the script at 30 seconds, iTunes will reach the end of the first sample and stop. By using a value just below 30 seconds, iTunes doesn’t quite finish playing, so it jumps to the next sample.Since you selected the Stay Open option, this script will keep working until you quit it.
[ Contributing Editor Rob Griffiths is the author of Mac OS X Power Hound, Panther Edition (O’Reilly, 2004), and runs the Mac OS X Hints Web site. ]Using Font Book by itself to preview many fonts simultaneously is difficult. So press F10 to access Exposé’s Application Windows mode and clearly preview each font in its own window.
Wikipedia is a large, community-driven encyclopedia. Any-one can add new records or modify existing ones. The idea is that over time com-munity members correct each other, and you’ll wind up with a very detailed collection of facts. It may not be the Encyclopaedia Brittanica, but it’s a great starting point for learning.
However, loading the Web site, entering your search terms, and clicking on the search button can be time-consuming. Lo and behold, by writing a simple script, you can run your queries from a Terminal window instead.
Unix holds executable programs in a folder called bin, so go ahead and create a bin folder in your Home directory, at the same level as Documents, Pictures, and so forth. You can do this via the Finder or type
mkdir ~/binin Terminal.
Once you’ve created this folder, make sure Unix knows about it when it looks for programs to run. In Terminal, create a file named .bash_profile in your home folder (or edit that file if it already exists). Start by typing
Next, add the line
export PATH=~/bin:$ PATH. EDITOR’S NOTE: There should be no space between the dollar sign and the word “PATH.”
Now press control-O (for Write Out) and then press return (to save the file). Then press control-X to exit the pico editor. Close and reopen your Terminal window; this will read the newly created .bash_profile file, telling Unix to look in your local bin folder for executable files.
All that’s left to do is to create the Wikipedia script (See top screenshot). Type
cd ~/bin, press return, type
pico wp, and press return again. You’re now editing the new script. Enter the following two lines:
#!/bin/bash open http://en.wikipedia.org/wiki/Special:Search? search=$(echo $ | sed 's/ /+/g')
When you’re done, the entry should look like the image in “Wild Wiki Ways.” As before, press control-O, return, and then control-X to save the file and quit the editor. The final step is to turn your script into an executable file. To do this, type
chmod +x wp. Press return to turn those two lines of text into a simple program.
To use your new script, just type
wp some text to search forand press return. Replace some text to search for with your search topic. Short phrases—
wp macintosh, for example—will probably lead to broader results.
When you press return, your default browser will open and load the Wikipedia results page for your search terms.
Here’s a short bonus tip: If you’ve already installed a text-mode browser such as links or lynx, then modify the above script so that the results display directly in your browser. Just replace the second line of the script with this text, replacing
lynx http://en.wikipedia.org/wiki/Special:Search? search=$(echo $ | sed 's/ /+/g')
As of OS X 10.3, Apple added something new to the left side of every Finder window: the sidebar. You can activate items in the sidebar with one click, as opposed to the double-click required in a normal Finder window. In its stock form, the sidebar contains useful time-savers, but if you customize it to fit the way you work, it can become a truly useful tool.
Take a look and you’ll see that the sidebar has two halves, separated by a light gray line. (Can’t see the sidebar? Double-click on the small dot located on the left side of your Finder window). The upper half contains icons for your computer; hard drives and partitions; and any connected servers and removable media, such as CDs or your iDisk. You can store pretty much anything you like in the lower half, but by default it contains shortcuts to your main user folders, including Desktop, Documents, Movies, Music, and Pictures. It also contains a shortcut to the systemwide Applications folder.
To make your sidebar more useful, go to the Finder: Preferences menu, select the Sidebar tab, and deselect any of the items you don’t want to see. Alternatively, you can remove shortcuts by dragging their icons off the sidebar and dropping them into the normal Finder window—when you release the mouse button, the shortcut will vanish in a puff of smoke. Don’t worry—only the shortcut gets erased, not the original item. To add something to the sidebar, drag and drop it into position.
You can add anything to the bottom portion, including files, folders, and applications (See bottom screenshot). For example, do you have a particular file you use regularly, such as your Quicken data file or a presentation you reference often? If so, consider giving it a spot on the sidebar. Deeply buried folders are also good candidates. Instead of opening a whole bunch of folders to reach the depths of your filing system, jump to the right spot with one click. Likewise, store frequently used applications in the sidebar, and you won’t have to make a trip to the Dock to activate them.
If you’re choosing between the sidebar and the toolbar, here are a couple of things to keep in mind: The relative size and position of shortcuts in the sidebar will change with the window size, but they will stay put in the toolbar. Shortcuts in the sidebar support pop-open folders, but those in the toolbar do not. You might want to consider keeping your application and document shortcuts in the toolbar, and your folder shortcuts in the sidebar.
For more-advanced sidebar tricks in previous Mac OS X Hints , see the tip on viewing paths when using folders from the sidebar (July 2004); the advice on using a superskinny sidebar (November 2004); and the very cool but very advanced tip on colorizing the sidebar’s background (January 2005).
Trash Images in Flash
Apple’s Preview tool is a useful way to scan and review a bunch of images quickly. Select them all in the Finder, and then drag and drop them onto Preview. The application opens one main window with a side drawer that contains image thumbnails. Click on any thumbnail to view the full-size version. Typically, you might then make note of the ones you don’t want to keep, switch to the Finder, and send the unwanted images to the Trash.
Here’s a time-saver—instead of deleting images from the Finder, delete them right from within Preview. Just drag the image you don’t want directly from the drawer to the Trash. You can drag only one image at a time, but this is still faster than switching to the Finder to get rid of images. You can also drag images to other locations from Preview’s drawer—directly into Photoshop for additional editing, for example, or into other Finder folders to create copies.Adding an item to the sidebar is easy; simply drag and drop it from a normal Finder window into place. You can store files, folders, and even applications here. When you want to remove an item, just drag it off the sidebar and watch it disappear. With this simple two-line script, you can use Terminal to browse entries quickly on the community-built encyclopedia Web site known as Wikipedia.