|This article needs additional citations for verification. (January 2012)|
Sherlock 3.6, Movies channel
|Stable release||3.6.2 (179)|
|Operating system||Mac OS X, Mac OS 8, 9|
Sherlock, named after Sherlock Holmes, was a file and web search tool created by Apple Inc. for the Mac OS, introduced with Mac OS 8.5 as an extension of the Mac OS Finder's file searching capabilities. Like its predecessor, it can search for local files and file contents, which it does using the same basic indexing code and search logic found in AppleSearch. Sherlock extended the system by allowing the user to search for items through the world wide web through a set of plugins that harness existing web search engines. These plugins were written as plain text files, so that it was a simple task for a user to write a Sherlock plugin.
Sherlock was replaced by Spotlight and Dashboard in Mac OS X 10.4 Tiger, although Apple continued to include it with the default installation. Since most of the standard plug-ins for Sherlock provided by Apple itself no longer function, it was officially retired and removed in the release of Mac OS X v10.5 Leopard in 2007.
Sherlock plugin file format
The Sherlock 2 search plugin is an SGML document, and is typically given the ".src" file extension. The Sherlock plug-in is composed of three parts, identified by their element names: <search>, <input>, and <interpret> tags. These elements allow Sherlock to (respectively) identify a search's engine's web page and the parts that are relevant to searching, as well as returning the results of the search. There is also a facility for defining how a Sherlock plug-in can update itself.
Sherlock search plugins can also be used (with minor modifications) in Mozilla's browser suites. These plugins are, appropriately enough, known as Mycroft project plugins (named after Mycroft Holmes, Sherlock Holmes' older brother). Among some of the changes made in the Sherlock file format is the separation of the automatic update element (which formed part of the <search> element) and the icon (provided in a separate file in Mozilla and part of the resource fork in Sherlock).
Sherlock 3 channels
The Sherlock 3 search plugin is a web application. It is downloaded on the fly from a server to ensure the latest version. Things change on the internet so quickly that this was one way for Apple to guarantee the newest version. A channel consists of a web directory with an index. This usually points to a sub-directory (usually called "Channel") which contains the code XML, any Script XML, and localized lproj directories (nib file and Localized Text Resources as a plist).
The ten channels included by default are:
The trigger mechanism is also used to set auxiliary variables. If an interface control is to response to an event, that trigger may start executing before some of the data is set in the control.
Two triggers may execute simultaneously. In rare instances, when a second trigger starts to run asynchronously, the code flow may stop in its tracks. This occurrence is rare and only appears with the use of async triggers. Triggers may be tasks as well. This means that if a trigger is being executed and the trigger is again pushing onto the queue, the executing trigger instance will stop. This allows information to be stopped if the user preempts the function with new data (when they click on the same control with, for instance, the third category instead of the first). Lastly, there is a timed trigger which can execute every x number of seconds. There is no finer time resolution.
Triggers may also have mutual exclusion (mutex).
the lproj directories come in the form of (two letter language code).lproj. e.g. en.lproj, ja.lproj, and de.lproj. These contain the nib files used for the interface of the Channel. Each interface element has a Sherlock title which is used in the code to reference it. The nib file may contain multiple windows. Just make sure to tell sherlock which window is the primary one. The String Resources is for text that will be used in the interface but can't be placed until the channel is run.
The DataStore object is the primary object which is used for communication, triggers, variable storage, and interface element parameters. Each element in the DataStore has a path separated by the period ".". Each trigger has a path in this DataStore. Notifying (or setting a ".action" on any other element, e.g. "MyChannelView.sometriggerORvariable.action") will cause the relevant trigger to execute. e.g. DataStore.Notify("MyChannel.someTrigger"); or DataStore.Set("MyChannel.someVariable"); This second example would trigger "MyChannel.someVariable.action" when the variable is Change. There is persistent storage in the DataStore.
Some disagree with this claim, stating that Sherlock 3 was the natural evolution of Sherlock 2, and that Watson was obviously meant to have some relation to Sherlock by its very name. Despite this, "Sherlocking" has become an accepted term used within the Mac and iOS developer community for Apple announcing a new system feature that seems similar to an existing third-party application.
- Sherlock - introduced in Mac OS 8.5.
- Sherlock 2 - shipped with Mac OS 9, new interface, more plugins.
- Sherlock 3 - shipped with Mac OS X v10.2, runs only in Mac OS X.
- Sherlock was replaced by Spotlight in Mac OS X v10.4 for hard drive searches, and replaced by Dashboard for other functionality, but remained as a stand-alone program with its channels. It was completely removed in Mac OS X v10.5.
- Apple: Sherlock 3 Channel Development
- Karelia: Watson FAQ - See "What is the relationship between Watson and the new Sherlock 3?".
- Karelia: Developing Tools for Watson - See "How does Watson's plug-in architecture compare to Sherlock 3?".