SpotlightItem.File
From Xojo Documentation
Read-Only Property (As FolderItem )
References the file that this SpotlightItem represents.
Example
This example uses File to access two items for each file in the loop.
Var 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.CellValueAt(ListBox1.LastAddedRowIndex, 1) = query.Item(i).Value("kMDItemDurationSeconds")
Next
Exception e As SpotlightException
MessageBox("A Spotlight error occurred.")
query.Synchronous = True
query.Run
For i As Integer = 0 To query.Count - 1
ListBox1.AddRow(query.Item(i).File.DisplayName)
ListBox1.CellValueAt(ListBox1.LastAddedRowIndex, 1) = query.Item(i).Value("kMDItemDurationSeconds")
Next
Exception e As SpotlightException
MessageBox("A Spotlight error occurred.")