Spotlight & Dashboard
I’ve started work on another widget suggested by Vincent - the same fellow who did the design for Evaluate. The widget is a launcher for other widgets similar to Spotlight or Quicksilver. The development has been fairly easy thus far. I’ve encountered a snag with the icons for applications. It seems that Dashboard (Safari) doesn’t support the .icns format for img tags. Currentlt it’s using a system call to find to seek the appropriate widgets/applications but I’m going to change that to a commmand which I’ve just learned of called mdfind. mdfind is the command line component of Spotlight and is used to search through the Spotlight meta-data index. It’s has an interesting syntax that is deceptively simple. From the mdfind man page:
NAME mdfind — finds files matching a given query SYNOPSIS mdfind [-live] [-onlyin directory] query
The query is a boolean statement that can be used to selectively filter the metadata that spotlight indexes. It could be something like kMDItemKind = 'Application' which would return only applications. To view the metadata for any particular file use the mdls command.
NAME mdls — lists the metadata attributes for the specified file SYNOPSIS mdls [-name attributeName] file …
Executing for example mdls /Applications/Stickies.app will return (among other things)
kMDItemDisplayName = "Stickies" kMDItemFSContentChangeDate = 2005-11-11 11:59:14 -0800 kMDItemKind = "Application"
I’ve found mdfind to be very fast and very useful.