Sherlock (software)
Encyclopedia
Sherlock, named after Sherlock Holmes
Sherlock Holmes
Sherlock Holmes is a fictional detective created by Scottish author and physician Sir Arthur Conan Doyle. The fantastic London-based "consulting detective", Holmes is famous for his astute logical reasoning, his ability to take almost any disguise, and his use of forensic science skills to solve...

, was a file and web search tool created by Apple Inc. for the Mac OS
Mac OS
Mac OS is a series of graphical user interface-based operating systems developed by Apple Inc. for their Macintosh line of computer systems. The Macintosh user experience is credited with popularizing the graphical user interface...

, introduced with Mac OS 8.5
Mac OS 8
Mac OS 8 is an operating system that was released by Apple Computer on July 26, 1997. It represented the largest overhaul of the Mac OS since the release of System 7, some six years previously. It puts more emphasis on color than previous operating systems...

 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
AppleSearch
AppleSearch was a client/server search engine from Apple Computer, first released for the "classic" Mac OS in 1994. AppleSearch appears to have seen little use in its original form, although much of the crawling, indexing and searching code was apparently re-used almost verbatim in Sherlock,...

. Sherlock extended the system by allowing the user to search for items through the world wide web
World Wide Web
The World Wide Web is a system of interlinked hypertext documents accessed via the Internet...

 through a set of plugins that harness existing web search engines. These plugins are written as plain text
Plain text
In computing, plain text is the contents of an ordinary sequential file readable as textual material without much processing, usually opposed to formatted text....

 files, so it is fairly simple for a user to write a Sherlock plugin.

Sherlock was replaced by Spotlight
Spotlight (software)
Spotlight is a system-wide desktop search feature of Apple's Mac OS X operating system. Spotlight is a selection-based search system, which creates a virtual index of all items and files on the system. It is designed to allow the user to quickly locate a wide variety of items on the computer,...

 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
Mac OS X v10.5
Mac OS X Leopard is the sixth major release of Mac OS X, Apple's desktop and server operating system for Macintosh computers. Leopard was released on 26 October 2007 as the successor of Tiger , and is available in two variants: a desktop version suitable for personal computers, and a...

 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: , , and tags. These elements allow Sherlock to (respectively) identify a search's engine's web page
Web page
A web page or webpage is a document or information resource that is suitable for the World Wide Web and can be accessed through a web browser and displayed on a monitor or mobile device. This information is usually in HTML or XHTML format, and may provide navigation to other web pages via hypertext...

 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
Mozilla
Mozilla is a term used in a number of ways in relation to the Mozilla.org project and the Mozilla Foundation, their defunct commercial predecessor Netscape Communications Corporation, and their related application software....

's browser suites. These plugins are, appropriately enough, known as Mycroft project
Mycroft project
The Mycroft project provides a collection of search plugins for Mozilla-based web browsers. The open source project is hosted on Mozdev.org and has been in existence since 2000...

 plugins
(named after Mycroft Holmes
Mycroft Holmes
Mycroft Holmes is a fictional character in the stories written by Arthur Conan Doyle. He is the elder brother of the famous detective Sherlock Holmes.- Profile :...

, 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 element) and the icon (provided in a separate file in Mozilla and part of the resource fork
Resource fork
The resource fork is a construct of the Mac OS operating system used to store structured data in a file, alongside unstructured data stored within the data fork. A resource fork stores information in a specific form, such as icons, the shapes of windows, definitions of menus and their contents, and...

 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
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

, any Script XML, and localized lproj directories (nib file and Localized Text Resources as a plist).

The ten channels included by default are:
  • Internet
    Internet
    The Internet is a global system of interconnected computer networks that use the standard Internet protocol suite to serve billions of users worldwide...

  • Pictures
  • Stocks
  • Movies
  • eBay
    EBay
    eBay Inc. is an American internet consumer-to-consumer corporation that manages eBay.com, an online auction and shopping website in which people and businesses buy and sell a broad variety of goods and services worldwide...

  • Flights
  • Dictionary
  • Translation
  • AppleCare
    AppleCare
    AppleCare is a service and support plan offered by Apple Inc. that extends the standard Apple warranty and phone support for its products to two years for iPods, iPads, and iPhones or three years for Macs.-AppleCare Protection Plan:...



A code XML file has an initialization code block, scripts, and triggers. The language for code is either JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

 or XQuery
XQuery
- Features :XQuery provides the means to extract and manipulate data from XML documents or any data source that can be viewed as XML, such as relational databases or office documents....

. The code flow model is unlike that of a procedural language (C++, Java, or any of the .NET languages). Sherlock uses triggers. There is a trigger queue that executes the bottom most trigger. This queue is first in first out. What makes this difficult is its non-linearity. Users can disrupt the flow by clicking elements of the interface.

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).

Script XML files are functions of Javascript and XQuery that may be called from the triggers.

the lproj directories come in the form of (two letter language code).lproj. eg. 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, eg. "MyChannelView.sometriggerORvariable.action") will cause the relevant trigger to execute. eg. 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.

Sherlock can call triggers through URLs. The channel identifier can be specified ("sherlock://com.mycompany.mychannel?param=value") but only when the channel is already running and needs to reference itself. The use of this is in javascript in a Web view in the channel for sending data/events back into the channel. This works by sending a parameter in the url without the equals nor the value. This would be the trigger that is thus executed. eg. "sherlock://com.mycompany.mychannel?runThisTrigger&dataForTrigger=someValue" would cause the trigger "URL.runThisTrigger" to execute. The second way to ensure that a url trigger is correctly interpreted is by using the trigger called "URL.complete". This trigger will run every time a URL is send to the channel through its channel url or its identifier. Lastly, within the "URL.complete" trigger, if you process the data from the variable "URL.query" then you can link your Channel with Applescript.

Current status

As of December 30, 2010, the operational status of the Sherlock channels is:
Internet: working
Stocks: not working (returns the error message "Company name or ticker symbol not found")
Movies: not working
eBay: not working
Flights: working
Dictionary: not working
Translation: not working
AppleCare: not working (returns Apple Knowledge Base documents that are not in English)


"Translation" eventually ceased to function in April 2011, within OS X 10.4.

Related software

Advocates of Watson
Karelia Watson
Watson is a software program released by Karelia Software for the Apple Macintosh on November 27, 2001, which provided Internet content through a familiar Mac OS X-like interface through the use of plug-ins....

 made by Karelia Software, LLC claim that Apple copied their product in without permission, compensation, and attribution in producing Sherlock 3.

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.

Versions

  • Sherlock - introduced in Mac OS 8.5
    Mac OS 8
    Mac OS 8 is an operating system that was released by Apple Computer on July 26, 1997. It represented the largest overhaul of the Mac OS since the release of System 7, some six years previously. It puts more emphasis on color than previous operating systems...

    .
  • Sherlock 2 - shipped with Mac OS 9
    Mac OS 9
    Mac OS 9 is the final major release of Apple's Mac OS before the launch of Mac OS X. Introduced on October 23, 1999, Apple positioned it as "The Best Internet Operating System Ever," highlighting Sherlock 2's Internet search capabilities, integration with Apple's free online services known as...

    , new interface, more plugins.
  • Sherlock 3 - shipped with Mac OS X v10.2
    Mac OS X v10.2
    Mac OS X version 10.2 "Jaguar" is the third major release of Mac OS X, Apple's desktop and server operating system. It superseded Mac OS X v10.1 code name Puma and preceded Mac OS X Panther...

    , runs only in Mac OS X
    Mac OS X
    Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

    .
  • Sherlock was replaced by Spotlight
    Spotlight (software)
    Spotlight is a system-wide desktop search feature of Apple's Mac OS X operating system. Spotlight is a selection-based search system, which creates a virtual index of all items and files on the system. It is designed to allow the user to quickly locate a wide variety of items on the computer,...

     in Mac OS X v10.4
    Mac OS X v10.4
    Mac OS X v10.4 Tiger is the fifth major release of Mac OS X, Apple's desktop and server operating system for Macintosh computers. Tiger was released to the public on 29 April 2005 for US$129.95 as the successor to Mac OS X Panther , which had been released 18 months earlier...

     for hard drive searches, and replaced by Dashboard for other functionality but remains as a stand-alone program with its channels. It was completely removed in Mac OS X v10.5
    Mac OS X v10.5
    Mac OS X Leopard is the sixth major release of Mac OS X, Apple's desktop and server operating system for Macintosh computers. Leopard was released on 26 October 2007 as the successor of Tiger , and is available in two variants: a desktop version suitable for personal computers, and a...

    .

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK