Mac OS X Unleashed

Mac OS X Unleashed

By John Ray and William C. Ray

Sherlock

When Sherlock was introduced in System 8.5, it signaled the beginning of Apple's integration of operating system functions with the Internet. Sherlock provides a universal Find feature that can search for files, text within files, and even Web sites. Some people might find it hard to get excited about a search tool, but it's difficult to understand the power of Sherlock until you try it. A friend of mine who recently moved to the Macintosh platform cites Sherlock as the feature that made her take the plunge. For anyone who needs instant access to information, no matter where it is stored, nothing comes close.

Sherlock Interface

Sherlock is not one tool, but three. Its most basic operation is as a file search utility. Type in a few characters from the filename you're looking for and let Sherlock go. In addition, Sherlock is a file indexer. When not actively searching, Sherlock compiles a database of the text contents of files on your drive. After the database is built, searching for a word or phrase takes a matter of seconds. Finally, Sherlock is an extensible Internet search tool that can perform Web searches on dozens of search engines simultaneously. Results are ranked and displayed with a summary of found pages. A single click launches the preferred Mac OS X Web browser to view the Web site.

Despite its advanced functionality, Sherlock works from within the extremely simple interface shown in Figure 7.24.

07fig24.jpg

Figure 7.24 All Sherlock's features are accessed from this simple interface.

The Sherlock window is divided into three panes, which can be resized using equal-sign handles. The top pane contains collections, or channels, of searches. There are eight default channels, from left to right:

Clicking a channel icon switches to that search collection. If you don't like the ordering of the icons, you can drag them to any available icon well in the top pane. You can also create new channels based on your own favorite search engines or new search plug-ins that you've downloaded from the Internet.

In the center of the Sherlock window are the search criteria and results. Before searching, the pane includes the available objects to search. After the search, the pane shows only the results. Clicking the back arrow returns to the search objects. The results shown in this pane are interactive. You can launch programs and applications by double-clicking their icons. Dragging a Web site URL to the Finder creates a shortcut to that URL. Dragging a file or folder moves that object to a new location. This is understood by trying it; so, don't worry if it doesn't quite make sense yet.

The lower portion of the window is the detail pane. After searching, if a result is selected, the details about that item are displayed. For file and content searches, it displays the path to that file. Content searches show a text snippet surrounding the located string. In Web searches, the URL and summary text are provided.

Now, let's see how this thing actually works.

Performing File and Content Searches

To perform a file search, select the first icon in the channel tray or choose Files (Command+F) from the Channels menu. The file search screen is shown in Figure 7.25.

07fig25.jpg

Figure 7.25 Use the file search screen to locate files by their name.

Each of the available search objects (hard drives, CD-ROMs, network volumes, folders, and so on) is listed. By default, only the mounted hard drives and your home directory are available. You can drag additional folders into the list to create additional search objects. This lets you limit your searches to only a portion of a hard drive. Click the check box in front of the objects you want to include in the search.

If you want to search the contents of files (rather than the filenames), you must first index the files. By default, Sherlock will try to index the search volumes automatically. To force a volume to be indexed, choose Index Now from the File menu when the desired search volume is selected. The indexing process might take a few minutes or a few hours to complete, depending on the amount of data to be scanned.

To search for a file by name, click the File Names radio button, and enter your search text in the field. Press Enter or click the Search button (shaped like a magnifying glass) to start the search.

In a few moments, the search results will be displayed. To stop the search in progress, click the Search button again. Figure 7.26 shows a completed search for Java. For each result, Sherlock lists the filename, kind of file, date it was modified, and its size. One of the files has been highlighted, and the path is shown in the details pane.

07fig26.jpg

Figure 7.26 Choose the objects to search and then click the Search (magnifying glass) button.

Searching for file contents is exactly the same. Just click the Contents radio button, select the search volumes, enter the search text, and go. Unlike the filename search, the content search includes a relevance field in the result listing. This ranks how closely Sherlock matched your search text to the document. The larger the relevance bar, the better the match is.

Because filename and contents are only a few of the possible criteria you might want to search for, Apple included a custom search feature to create new types of searches. To use a custom search, click the Custom radio button, and then choose from the pop-up menu. Four default custom searches are available from the Custom menu: Applications, files larger than 1MB, files modified today, and files modified yesterday.

In addition to the four custom options, you can use the Edit selection in the Custom menu to add your own search type. Sherlock will open the More Search Options window to create your own search types. Click the Advanced Options disclosure push button to see even more available search criteria. Figure 7.27 shows the expanded search options window.

07fig27.jpg

Figure 7.27 Don't see the search you want? Add your own.

Choose from any (or all) of these available options:

After you set your custom options, click OK to use the custom search. If you've created a search that you might want to use repeatedly, click Save As to enter a name; your new search will now appear under the Custom pop-up menu. Finally, if you happen to be editing a search and want to delete it, click Delete to remove the custom search.

Performing Internet Searches

To search the Internet, choose one of the available Internet search channels. In the center pane of the Sherlock window, you'll see the available search sites to choose from, as demonstrated in Figure 7.28.

07fig28.jpg

Figure 7.28 Click the search sites that you want to query.

Choose the search engines that you want to use by clicking the check box in front of their names. To quickly toggle between all off and all on, use Turn Off/On All (Command+T) from the Edit menu. This function will also toggle highlighted items in the list between their on and off states.

Finally, enter your search text into the search field and click the magnifying glass button. Within a few seconds, the search results will be displayed. Figure 7.29 shows an Internet search for the word Java.

07fig29.jpg

Figure 7.29 Each search engine is queried, and then a combined list of the results is displayed.

Depending on the type of search you're running, you might see a variety of fields in the results. The generic Internet search displays the name of the located page, the relevance, and the site it is located on. People searches, on the other hand, include phone numbers and e-mail addresses (if available). Shopping searches display the availability of a product and its cost (allowing for quick sorts based on price). Double-click any line in the search results list to open the URL in your Web browser.

To display addition information about one of the located items, select it in the search results pane. The details will be displayed at the bottom of the window. Lines highlighted in blue are hyperlinks and can be clicked to open the link in your preferred Web browser.

Customizing Channels

To organize your favorite Internet searches, you can make your own Sherlock channels. To create a new channel, choose New Channel from the Channels menu. The New Channel dialog box shown in Figure 7.30 will be displayed.

07fig30.jpg

Figure 7.30 Create new channels with your favorite search engines.

To set up your channel, you must name it and provide a channel type. The channel type determines what fields will be displayed in the searches. Four channel types are available: Searching, People, Shopping, and News.

The basic Searching channel retrieves a page URL, its relevance in a search, and the name of the site. Using the People channel, you can locate individual's e-mail addresses and phone numbers. The Shopping channel includes availability and price fields for comparison shopping. Finally, News channels are like the basic Searching channels, but include a date field.

In addition to setting the channel type, you can also choose an icon for your channel by clicking the up and down arrows by the icon well. Finally, enter a description of the channel if you're afraid you won't remember what it's for.

Click OK to create the new channel. The icon chosen for the channel will be added to the top of the Sherlock window. You can drag the icon around to position it in any of the icon wells. Dragging on top of an existing channel will delete that channel (unless it is a built-in channel).

To edit or delete a channel, select its icon and then use the appropriate menu option from the Channels menu.

Adding Search Sites

What good is a channel if it doesn't have any search sites? To add existing search sites to a channel, follow these steps:

  1. Open a new Sherlock window (Command+N).
  2. Choose the channel with the existing search site you want to move or copy.
  3. Drag the search site's icon to the search pane of the new channel.

Chances are that you're less than thrilled with having only the option to rearrange the built-in search site plug-ins. Thankfully, Apple built Sherlock's plug-in architecture so that developers could easily create new plug-ins based on simple rules. There are hundreds of available search site plug-ins that you can download and add to your custom channels.

The Sherlock plug-in architecture relies on search Web pages to be laid out in a logical and repeating fashion. To a Web search engine, Sherlock is just another browser sending a search request. When the results are returned, Sherlock searches through them for recognizable elements.

For example, many search engines return their results in the form of a table, like this:

<TABLE>
<TR><TD>Result 1</TD><TD>Description</TD></TR>
<TR><TD>Result 2</TD><TD>Description</TD></TR>
<TR><TD>Result 3</TD><TD>Description</TD></TR>
<TR><TD>Result 4</TD><TD>Description</TD></TR>
...and so on...
</TABLE>

Here, each result is displayed within a table row-one after another. The search site plug-ins take advantage of this repeating nature to identify which text in the resulting HTML belongs in the Sherlock result fields. To learn more about this process and authoring your own Sherlock plug-ins, read Apple's developer documentation at http://developer.apple.com/technotes/tn/tn1141.html.

The easiest way to find prebuilt plug-ins is to visit the Sherlock Plug-ins for Power Searchers Web site, located at http://pwsearcher.users1.50megs.com/sherlock/srccoms.html. See Chapter 8 for information on downloading and uncompressing applications and files.

A downloaded plug-in can be recognized by its .src extension. To install a plug-in, drag its icon from the Finder into the search pane of the Sherlock window. It will be immediately added to the current channel. You can also choose Add Search Site from the Channels menu, and then locate the .src file on your drive.

Sherlock continues to gain new plug-ins on a daily basis. A Google search for Sherlock plug-in yields an incredible number of results.

If you can find it on the web, there's a Sherlock plug-in to help you find it faster.

Configuration

Sherlock has a single Preferences panel, shown in Figure 7.31.

07fig31.jpg

Figure 7.31 Set the number of simultaneous Web requests Sherlock can make as well as the options for indexing the drive.

There are four options you can set. These can greatly affect Sherlock's performance, so you might want to adjust the settings to suit your environment.

The first option, Maximum number of connections, determines how Sherlock uses your network. Sherlock typically performs many Web searches in parallel. The maximum number of connections is, by default, unlimited. For dial-in users, creating a large number of simultaneous connections might actually take longer than making a few connections at a time. The overhead required to manage the connections suddenly becomes a significant portion of the bandwidth. Try choosing a lower number if you are using many search engines and the results are taking a long time to return.

Next, the Automatically index items when Sherlock is opened option is used to trigger automatic indexing. When checked, Sherlock will start indexing your search volumes as soon as it is started. This can slow down overall system performance and is unnecessary unless you are performing content searches. If the Automatically index folders when they're added setting is checked, a folder that is dragged to the Files channel will be indexed immediately.

By default, Sherlock indexes a large number of languages besides English! You can speed up the indexing process by clicking the Languages button and choosing only the languages that you use.

Click OK to save the Sherlock preferences.

Advanced Configuration

When you add Sherlock search plug-ins, they're moved to an area where all users can access them. Unlike other components, this isn't in the Library folder. Instead, Sherlock stores the plug-ins inside the Sherlock application. If you're interested in getting to the plug-in source directly, you can access it through this path: /Applications/Sherlock. app/Contents/Resources/English.lproj. Similarly, the channel definitions are stored at /Applications/Sherlock.app/Contents/Resources/Channels.

In addition, the Content indexing system has a few files that you might want to take a look at. Open the folder /System/Library/Find. There are five files that control how the indexer works for English documents:

Changing any of these files is an at-your-own-risk operation, but it does offer a greater level of control over the indexing process than through the Sherlock interface.

Menus

Sherlock's menus provide access to common operations for working with files. The keyboard shortcuts can help turn Sherlock into one of the easiest ways of navigating your drive, launching applications, and opening files.

File

Use the options in the file menu to operate on URLs or files and folders that have been found, as well as perform standard window operations:

Edit

The Edit menu contains the usual cut/paste tools, along with the additional Turn Off/On toggle selection (Command+T).

Find

The Find menu can be used to control Sherlock's file indexing and custom searching. One item of interest is the Find Similar Files selection, which can be used to locate files with similar qualities to a single given file.

Channels

The Sherlock Channels menu gives you the ability to customize your own channels with your favorite plug-ins. Custom channels are really useful only for users with large collections of plug-ins.

Share ThisShare This

Informit Network