10.5: How to refine Spotlight searches in 10.5

I found some prior hints on the site about using boolean searches in 10.4; there are now easier ways of doing this, and a more powerful way of refining what you search for, in Leopard. In Spotlight, or just the find bar in a Finder window, you can type sun NOT set (the capitalization of NOT is important) to instantly show all matches, except those containing 'sunset.' The same can be done with OR and AND modifiers.To extend this and do super specific searches, you can use file attributes. For example, I want to exclude movie frames from an image search, so I would type .tga NOT PixelWidth:720. There are many attributes you can use -- to find these for a specific file, use Terminal and type mdls, press the Space Bar, and then type the path to that file's location (or just drag it in from the Finder). Terminal will return a list...

published on Friday, the 24. October 2008, macosxhints

Enable Spotlight indexing in iPhoto 6

For those of you still stuck with iPhoto 6, I discovered how to enable Spotlight to properly index iPhotos -- including keywords, titles and other details. I am not sure if this applies to every iPhoto 6 user, but in my iPhoto 6 application, Apple forgot to tell Spotlight what to look for. Follow these steps to fix this: Open /Applications, Control-click on iPhoto, and select Show Package Contents from the pop-up menu. In the new window that opens, locate the Contents/Info.plist file. Open TextEdit, and drag the Info.plist file onto the TextEdit icon in the Dock to open it. Please make a copy of the file before editing, just in case! At the end of the file, just before </dict></plist>, insert the following code: <key>UTExportedTyp​eDeclarations&lt...

published on Wednesday, the 1. October 2008, macosxhints

A caution on Spotlight searches and ampersands

While working on HTML files, I often use a special character, the 'em-dash' (—). In HTML code, an em-dash is made using a numerical code that begins with an ampersand (&): &#8212; I wanted to search for all my HTML files containing that code, but Spotlight wouldn't find them if I typed in the whole code. If I left off the initial ampersand (#8212), Spotlight would find the entries. It seems to me that Spotlight can only find ampersands in certain cases, but which ones those are, I don't know yet. So if you're looking for coded HTML entities in your files, try searching without the ampersand.

published on Thursday, the 25. September 2008, macosxhints

One way to 'link' to files, folders, etc. in iWork documents

iWork apps only allow hyperlinks to web pages, to create email messages, and to bookmarked pages in your iWork document. However, I find it useful to have links to other files in the iWork document, as it saves digging around the file system. I normally create links by selecting the file in the Finder then going to Services » TextEdit » New Window Containing Selection. This opens a TextEdit window with a link to the file, which I can then copy into any Cocoa based document. iWork apps, however, only paste this link as text. To overcome this, I type in a line of text in the document (or in a comment) that specifies some combination of Spotlight type, attribute, and search text. I can then highlight this text and use a keyboard shortcut for the Spotlight Services menu item to bring up a Finder window containing matching items. This search can be very precise if required, and has the additional benefit that if the files are moved, they can still be found -- a traditional l...

published on Thursday, the 17. April 2008, macosxhints

10.5: Find iTunes song lyrics using Spotlight

I'm a huge fan of the lyrics capabilities of iTunes, but I was a little dismayed by the fact that Spotlight didn't include song lyrics in its indexing ... until Leopard, apparently! I didn't try this on purpose, but I typed tech into the Spotlight search field, and together with the folder I was looking for, the search results also listed the MP3 file of U2's Zooropa -- the first track of the album with the same name. How could that be? I immediatly recalled the bit of the lyrics that goes 'Zooropa, vorsprung durch Technik.' So I typed in some additional lyrics into the Spotlight field. To my great delight, it's now possible to search into your iTunes lyrics library from Spotlight, provided that you have previously filled up your MP3s with the lyrics.

published on Tuesday, the 26. February 2008, macosxhints

10.5: Run Spotlight searches based on Finder labels

To find files by label with Spotlight, or in the Finder's find box, type label:1 (or any other number up to 7). The numbers don't seem to correspond exactly to the order in the Finder; but you can see them by doing mdls on files. Here's how each number corresponds to one of the Finder's label colors:0 - None1 - Gray2 - Green3 - Purple4 - Blue5 - Yellow6 - Red7 - OrangeThe actual key name is kMDItemFSLabel in the mdls output.

published on Monday, the 31. December 2008, macosxhints

10.5: Search for files by name in Finder

If you are looking for a file by name, and don't want to use Spotlight's File Name button, just press and hold Shift, select the Finder's File menu, and notice that the Find entry has become Find by name. Select that entry, and the Finder will open a new window with a preset search set up for Name Contains; type your filename, and you're done. [robg adds: You'll see a bit of a visual bug when you do this: the search dialog will have Contents, not File Name highlighted, and then the Name Contains line below that. So technically, it seems you're searching files whose contents contain a file name you specify. Clearly that doesn't make any sense. In any event, it seems Apple heard the complaints about easier filename searching. You can take the shortcut to this solution by pressing Shift-Command-F, or you can just type name:somefile or name:"some multiwo...

published on Wednesday, the 14. November 2007, macosxhints

10.5: View iCal events with Quick Look and Cover Flow

I discovered that if you do a Spotlight search for a particular file and you end up having an iCal event in the search results (in the Finder window), you can use Quick Look to see a little day calendar page icon with that date on it, and some details of that iCal event.The same is true if you do a File » Get Info (Command-I) on that item. The difference here is that in the Preview area of the Get Info window, the event details will be show directly on the Calendar icon. Further to this, if you view your Spotlight search results in Cover Flow view, you get a nice big representation of that calendar page.The cool thing about this is that if I've got my work shifts set up in iCal, and I wish to see when I'm working a night shift, I type "night shift" into Spotlight and view the results in Cover Flow view. By selecting File Name instead of Contents (to exclude extraneous it...

published on Thursday, the 1. November 2007, macosxhints

Create custom date and time formats in Numbers '08

Numbers '08 seems to have an overly limited list of date and time formats. I'm sure they're enough for most people, but my aesthetic sense demanded one that wasn't listed. It doesn't look like you can add other formats within the actual program, but there is a plist file you can edit. (I've also posted this on Apple's Discussions site.)Quit Numbers if it's running, then control-click on the Numbers application icon and choose Show Package Contents from the pop-up menu. Type date into the Spotlight field in the Finder window, and click on the DateTimeFormats folder. Alternatively, drill down into Contents » Frameworks » SFUtility.framework » Versions » A » Resources » DateTimeFormats.Control-click on en_US.plist (or your language's plist file) and click Duplicate to make a backup. (Just rename the backup if you damage something.) Open en_US.plis...

published on Wednesday, the 15. August 2007, macosxhints

10.4: Use Spotlight to view missing 'image icons'

I'm an graphic artist who downloads lots and lots of preview JPEGs from commercial photograph websites. I also have a large photo collection of my own. One of my problems was that not all JPEGs have an icon that shows a picture of the file. So when I've downloaded dozens of pictures, it's sometimes hard to know which is which. I found using Spotlight is the easy answer. I put all my JPEGs into a folder, open the folder, and in the Spotlight search panel type jpg, and search that folder only. Presto -- up pop the JPEG icons of all my downloads as little pictures, so I can either rename or remember which is which. And of course, the same applies to other similar graphic or Photoshop files. [robg adds: There are many third-party apps that can add image previews, saving the Spotlight step. Off the top of my head, ...

published on Monday, the 5. March 2007, macosxhints