SpotlightException

From Real Software Documentation

Jump to: navigation, search
Class (inherits from RuntimeException)

Used to handle exceptions related to Spotlight queries, such as a invalid query passed to the Query property of a SpotlightQuery control.

Example

This example adds an Exception block to a button Action event handler in case of an spotlight query error.

Dim query as New SpotlightQuery("kMDItemContentTypeTree == 'public.audio'")
query.Synchronous=True
query.Run
For i as Integer = 0 to query.Count-1
ListBox1.Addrow query.Item(i).File.DisplayName
ListBox1.Cell(ListBox1.LastIndex,1)=query.Item(i).File.AbsolutePath
Next

Exception err as SpotlightException
MsgBox "A Spotlight error occurred."


See Also

Exception, Try statements, RuntimeException, SpotlightItem, SpotlightQuery classes.

Personal tools