Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example: MBS MacOSX Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacOSX/Spotlight/MDItem
This example is the version from Fri, 14th May 2015.
Project "MDItem.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
EventHandler Sub DropObject(obj As DragItem, action As Integer)
do
if obj.FolderItemAvailable then
update new MDItemMBS(obj.FolderItem)
end if
loop until not obj.NextItem
End EventHandler
EventHandler Sub Open()
AcceptFileDrop MyFileTypes.Any
if not TargetMachO then
MsgBox "This example need Mac OS X 10.4 or newer"
quit
end if
dim item as new MDItemMBS(SpecialFolder.Desktop)
update item
End EventHandler
Sub update(item as MDItemMBS)
List.DeleteAllRows
dim names(-1) as string = item.AttributeNames
for each name as string in names
dim v as Variant = item.GetAttribute(name)
if v.IsArray then
v="<array>"
end if
List.AddRow name
List.Cell(List.LastIndex,1)=item.DisplayNameForAttribute(name)
List.Cell(List.LastIndex,2)=v
List.Cell(List.LastIndex,3)=item.DisplayDescriptionForAttribute(name)
List.Cell(List.LastIndex,4)=item.AttributeType(name)
if item.AttributeMultiValued(name) then
List.Cell(List.LastIndex,5)="yes"
else
List.Cell(List.LastIndex,5)="no"
end if
next
End Sub
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
MyFileTypes
Filetype special/any
End MyFileTypes
End Project
The items on this page are in the following plugins: MBS MacOSX Plugin.