Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/Util/GetSpecialFolder Example
Function:
Required plugins for this example: MBS MacOSX Plugin, MBS Util Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/GetSpecialFolder Example
This example is the version from Mon, 5th May 2013.
Project "GetSpecialFolder Example.rbp"
Class Window1 Inherits Window
Control ListBox1 Inherits ListBox
ControlInstance ListBox1 Inherits ListBox
End Control
Control PopupMenu1 Inherits PopupMenu
ControlInstance PopupMenu1 Inherits PopupMenu
EventHandler Sub Change() run End EventHandler
EventHandler Sub Open() me.addrow "On System Disk" me.rowTag(0)=kOnSystemDisk me.addrow "On Appropriate Disk" me.rowTag(1)=kOnAppropriateDisk me.addrow "System Domain" me.rowTag(2)=kSystemDomain me.addrow "Local Domain" me.rowTag(3)=kLocalDomain me.addrow "Network Domain" me.rowTag(4)=knetworkDomain me.addrow "User Domain" me.rowTag(5)=kuserDomain me.addrow "Classic Domain" me.rowTag(6)=kclassicDomain 'me.listindex=0 End EventHandler
End Control
Sub run() dim n as integer n=popupMenu1.rowtag(popupMenu1.listindex) listBox1.deleteAllRows 'test AdminToolsFolderMBS(n),"AdminToolsFolder" 'test CookiesFolderMBS(n),"CookiesFolder" 'test HistoryFolderMBS(n),"HistoryFolder" 'test InternetCacheFolderMBS(n),"InternetCacheFolder" test WindowsFolderMBS,"WindowsFolder" test WindowsSystemFolderMBS,"WindowsSystemFolder" test SystemFolderMBS(n),"SystemFolder" test DesktopFolderMBS(n),"DesktopFolder" test SystemDesktopFolderMBS(n),"SystemDesktopFolder" test TrashFolderMBS(n),"TrashFolder" test SystemTrashFolderMBS(n),"SystemTrashFolder" test WhereToEmptyTrashFolderMBS(n),"WhereToEmptyTrashFolder" test PrintMonitorDocsFolderMBS(n),"PrintMonitorDocsFolder" test StartupFolderMBS(n),"StartupFolder" test ShutdownFolderMBS(n),"ShutdownFolder" test AppleMenuFolderMBS(n),"AppleMenuFolder" test ControlPanelFolderMBS(n),"ControlPanelFolder" test SystemControlPanelFolderMBS(n),"SystemControlPanelFolder" test ExtensionFolderMBS(n),"ExtensionFolder" test FontsFolderMBS(n),"FontsFolder" test PreferencesFolderMBS(n),"PreferencesFolder" test SystemPreferencesFolderMBS(n),"SystemPreferencesFolder" test TemporaryFolderMBS(n),"TemporaryFolder" test ExtensionDisabledFolderMBS(n),"ExtensionDisabledFolder" test ControlPanelDisabledFolderMBS(n),"ControlPanelDisabledFolder" test SystemExtensionDisabledFolderMBS(n),"SystemExtensionDisabledFolder" test StartupItemsDisabledFolderMBS(n),"StartupItemsDisabledFolder" test ShutdownItemsDisabledFolderMBS(n),"ShutdownItemsDisabledFolder" test ApplicationsFolderMBS(n),"ApplicationsFolder" test DocumentsFolderMBS(n),"DocumentsFolder" test VolumeRootFolderMBS(n),"VolumeRootFolder" test ChewableItemsFolderMBS(n),"ChewableItemsFolder" test ApplicationSupportFolderMBS(n),"ApplicationSupportFolder" test TextEncodingsFolderMBS(n),"TextEncodingsFolder" test StationeryFolderMBS(n),"StationeryFolder" test OpenDocFolderMBS(n),"OpenDocFolder" test OpenDocShellPlugInsFolderMBS(n),"OpenDocShellPlugInsFolder" test EditorsFolderMBS(n),"EditorsFolder" test OpenDocEditorsFolderMBS(n),"OpenDocEditorsFolder" test OpenDocLibrariesFolderMBS(n),"OpenDocLibrariesFolder" test GenEditorsFolderMBS(n),"GenEditorsFolder" test HelpFolderMBS(n),"HelpFolder" test InternetPlugInFolderMBS(n),"InternetPlugInFolder" test ModemScriptsFolderMBS(n),"ModemScriptsFolder" test PrinterDescriptionFolderMBS(n),"PrinterDescriptionFolder" test PrinterDriverFolderMBS(n),"PrinterDriverFolder" test ScriptingAdditionsFolderMBS(n),"ScriptingAdditionsFolder" test SharedLibrariesFolderMBS(n),"SharedLibrariesFolder" test VoicesFolderMBS(n),"VoicesFolder" test ControlStripModulesFolderMBS(n),"ControlStripModulesFolder" test AssistantsFolderMBS(n),"AssistantsFolder" test UtilitiesFolderMBS(n),"UtilitiesFolder" test AppleExtrasFolderMBS(n),"AppleExtrasFolder" test ContextualMenuItemsFolderMBS(n),"ContextualMenuItemsFolder" test MacOSReadMesFolderMBS(n),"MacOSReadMesFolder" test ALMModulesFolderMBS(n),"ALMModulesFolder" test ALMPreferencesFolderMBS(n),"ALMPreferencesFolder" test ALMLocationsFolderMBS(n),"ALMLocationsFolder" test ColorSyncProfilesFolderMBS(n),"ColorSyncProfilesFolder" test ThemesFolderMBS(n),"ThemesFolder" test FavoritesFolderMBS(n),"FavoritesFolder" test InternetFolderMBS(n),"InternetFolder" test AppearanceFolderMBS(n),"AppearanceFolder" test SoundSetsFolderMBS(n),"SoundSetsFolder" test DesktopPicturesFolderMBS(n),"DesktopPicturesFolder" test InternetSearchSitesFolderMBS(n),"InternetSearchSitesFolder" test FindSupportFolderMBS(n),"FindSupportFolder" test FindByContentFolderMBS(n),"FindByContentFolder" test InstallerLogsFolderMBS(n),"InstallerLogsFolder" test ScriptsFolderMBS(n),"ScriptsFolder" test FolderActionsFolderMBS(n),"FolderActionsFolder" test LauncherItemsFolderMBS(n),"LauncherItemsFolder" test RecentApplicationsFolderMBS(n),"RecentApplicationsFolder" test RecentDocumentsFolderMBS(n),"RecentDocumentsFolder" test RecentServersFolderMBS(n),"RecentServersFolder" test SpeakableItemsFolderMBS(n),"SpeakableItemsFolder" test KeychainFolderMBS(n),"KeychainFolder" test QuickTimeExtensionsFolderMBS(n),"QuickTimeExtensionsFolder" test DisplayExtensionsFolderMBS(n),"DisplayExtensionsFolder" test MultiprocessingFolderMBS(n),"MultiprocessingFolder" test PrintingPlugInsFolderMBS(n),"PrintingPlugInsFolder" test DomainTopLevelFolderMBS(n),"DomainTopLevelFolder" test DomainLibraryFolderMBS(n),"DomainLibraryFolder" test ColorSyncFolderMBS(n),"ColorSyncFolder" test ColorSyncCMMFolderMBS(n),"ColorSyncCMMFolder" test ColorSyncScriptingFolderMBS(n),"ColorSyncScriptingFolder" test PrintersFolderMBS(n),"PrintersFolder" test SpeechFolderMBS(n),"SpeechFolder" test CarbonLibraryFolderMBS(n),"CarbonLibraryFolder" test DocumentationFolderMBS(n),"DocumentationFolder" test DeveloperDocsFolderMBS(n),"DeveloperDocsFolder" test DeveloperHelpFolderMBS(n),"DeveloperHelpFolder" test ISSDownloadsFolderMBS(n),"ISSDownloadsFolder" test UserSpecificTmpFolderMBS(n),"UserSpecificTmpFolder" test CachedDataFolderMBS(n),"CachedDataFolder" test FrameworksFolderMBS(n),"FrameworksFolder" test PrivateFrameworksFolderMBS(n),"PrivateFrameworksFolder" test ClassicDesktopFolderMBS(n),"ClassicDesktopFolder" test DeveloperFolderMBS(n),"DeveloperFolder" test SystemSoundsFolderMBS(n),"SystemSoundsFolder" test ComponentsFolderMBS(n),"ComponentsFolder" test QuickTimeComponentsFolderMBS(n),"QuickTimeComponentsFolder" test CoreServicesFolderMBS(n),"CoreServicesFolder" test PictureDocumentsFolderMBS(n),"PictureDocumentsFolder" test MovieDocumentsFolderMBS(n),"MovieDocumentsFolder" test MusicDocumentsFolderMBS(n),"MusicDocumentsFolder" test InternetSitesFolderMBS(n),"InternetSitesFolder" test PublicFolderMBS(n),"PublicFolder" test AudioSupportFolderMBS(n),"AudioSupportFolder" test AudioSoundsFolderMBS(n),"AudioSoundsFolder" test AudioSoundBanksFolderMBS(n),"AudioSoundBanksFolder" test AudioAlertSoundsFolderMBS(n),"AudioAlertSoundsFolder" test AudioPlugInsFolderMBS(n),"AudioPlugInsFolder" test AudioComponentsFolderMBS(n),"AudioComponentsFolder" test KernelExtensionsFolderMBS(n),"KernelExtensionsFolder" test DirectoryServicesFolderMBS(n),"DirectoryServicesFolder" test DirectoryServicesPlugInsFolderMBS(n),"DirectoryServicesPlugInsFolder" test InstallerReceiptsFolderMBS(n),"InstallerReceiptsFolder" test FileSystemSupportFolderMBS(n),"FileSystemSupportFolder" test AppleShareSupportFolderMBS(n),"AppleShareSupportFolder" test AppleShareAuthenticationFolderMBS(n),"AppleShareAuthenticationFolder" test MIDIDriversFolderMBS(n),"MIDIDriversFolder" test LocalesFolderMBS(n),"LocalesFolder" test FindByContentPluginsFolderMBS(n),"FindByContentPluginsFolder" test UsersFolderMBS(n),"UsersFolder" test CurrentUserFolderMBS(n),"CurrentUserFolder" test CurrentUserRemoteFolderLocationFolderMBS(n),"CurrentUserRemoteFolderLocationFolder" test CurrentUserRemoteFolderMBS(n),"CurrentUserRemoteFolder" test SharedUserDataFolderMBS(n),"SharedUserDataFolder" test VolumeSettingsFolderMBS(n),"VolumeSettingsFolder" // new in Mac OS X 10.3: test dictionariesFolderMBS(n),"DictionariesFolder" test LogsFolderMBS(n),"LogsFolder" test DeveloperApplicationsFolderMBS(n),"DeveloperApplicationsFolder" test PreferencePanesFolderMBS(n),"PreferencePanesFolder" End Sub
Sub test(f as folderItem,name as string) dim s as string dim e as TextEncoding listBox1.addrow name if f<>nil then s=f.UnixpathMBS listBox1.cell(listbox1.lastindex,1)=s end if e=s.Encoding ListBox1.Cell(ListBox1.LastIndex,2)=e.internetName+" "+str(len(s))+" "+str(lenb(s)) 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
Module Domainconstants
Const kClassicDomain = -32762
Const kLocalDomain = -32765
Const kNetworkDomain = -32764
Const kOnAppropriateDisk = -32767
Const kOnSystemDisk = -32768
Const kSystemDomain = -32766
Const kUserDomain = -32763
End Module
Class App Inherits Application
End Class
End Project

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Util Plugin.




Links
MBS Xojo blog