You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/Paths
Class Window1 Inherits Window
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
dim f as folderItem
f=getopenFolderItem("special/any")
if f<>Nil then
run f
end if
End EventHandler
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
Control StaticText4 Inherits Label
ControlInstance StaticText4 Inherits Label
End Control
Control StaticText5 Inherits Label
ControlInstance StaticText5 Inherits Label
End Control
Control filename Inherits Label
ControlInstance filename Inherits Label
End Control
Control displayname Inherits Label
ControlInstance displayname Inherits Label
End Control
Control NativePath Inherits Label
ControlInstance NativePath Inherits Label
End Control
Control longpath Inherits Label
ControlInstance longpath Inherits Label
End Control
Control shortpath Inherits Label
ControlInstance shortpath Inherits Label
End Control
Control StaticText6 Inherits Label
ControlInstance StaticText6 Inherits Label
End Control
Control unixpath Inherits Label
ControlInstance unixpath Inherits Label
End Control
EventHandler Sub DropObject(obj As DragItem, action As Integer)
do
if obj.folderItemavailable then
run obj.folderItem
end if
loop until not obj.nextItem
End EventHandler
EventHandler Sub Open()
me.acceptfileDrop "special/any"
End EventHandler
Sub run(f as folderItem)
filename.text=f.name
displayname.text=f.displayName
longpath.text=f.LongPathMBS // in Win plugin
shortpath.text=f.ShortPathMBS
unixpath.text=f.UnixpathMBS
NativePath.text=f.NativePath
End Sub
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class