Sherlock (software)

Missing image
Sherlock2_OS9.jpg
Sherlock 2 for Mac OS 9, Files Channel

Sherlock, named after Sherlock Holmes, is the file and web searching tool made by Apple Computer 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, but it can also search for items through the world wide web through a set of plugins that harness existing web search engines. These plugins are plain text files, so it is fairly simple for a user to write a Sherlock plugin.

Contents

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

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

A code XML file has an initialization code block, scripts, and triggers. The language for code is either JavaScript or XQuery. 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. This can cause bad data to enter your function. You are thus Warned!

Two triggers may execute simultaneously. My studies have shown a bug that in rare instances, when a second trigger starts to run asynchronously, the code flow may stop in its tracks. You are thus Warned! This is VERY rare and only occurs 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.

Lastly, Sherlock can call triggers through URLs. You can specify the channel identifier ("sherlock://com.mycompany.mychannel?param=value") but this only works 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 it's 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.

Related Software

Advocates of Watson made by Karelia Software, LLC claim that Apple copied their product without permission, compensation, and attribution.

Versions

See also: Mycroft project

External links

Navigation

  • Art and Cultures
    • Art (https://academickids.com/encyclopedia/index.php/Art)
    • Architecture (https://academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (https://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (https://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools