Platforms to show: All Mac Windows Linux Cross-Platform
NSWorkspaceMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Cocoa | MBS MacCocoa Plugin | 8.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Example:
// get icon image
dim n as NSImageMBS = NSWorkspaceMBS.iconForFile(SpecialFolder.desktop)
// set the size we want
n.setSize 512,512
// make a copy as picture
Backdrop = n.CopyPictureWithMask
- Opening, manipulating, and obtaining information about files and devices
- Tracking changes to the file system, devices, and the user database
- Launching applications
- event requestAuthorizationCompleted(type as Integer, authorization as NSWorkspaceAuthorizationMBS, error as NSErrorMBS, tag as variant)
- 7 shared properties
- shared property accessibilityDisplayShouldDifferentiateWithoutColor as Boolean
- shared property accessibilityDisplayShouldIncreaseContrast as Boolean
- shared property accessibilityDisplayShouldInvertColors as Boolean
- shared property accessibilityDisplayShouldReduceMotion as Boolean
- shared property accessibilityDisplayShouldReduceTransparency as Boolean
- shared property isSwitchControlEnabled as Boolean
- shared property isVoiceOverEnabled as Boolean
- method requestAuthorization(type as integer, tag as variant = nil)
- 89 shared methods
- shared method absolutePathForAppBundleWithIdentifier(bundleIdentifier as string) as string
- shared method activateFileViewerSelectingFiles(Files() as folderitem)
- shared method activateFileViewerSelectingURLs(URLs() as string)
- shared method desktopImageOptionsForScreen(screen as NSScreenMBS) as dictionary
- shared method desktopImageURLForScreen(screen as NSScreenMBS) as folderitem
- shared method fileLabelColors as NSColorMBS()
- shared method fileLabels as string()
- shared method findApplications
- shared method frontmostApplication as NSRunningApplicationMBS
- shared method fullPathForApplication(appname as string) as folderitem
- shared method hideOtherApplications
- shared method iconForFile(file as folderitem) as NSImageMBS
- shared method iconForFiles(files() as folderitem) as NSImageMBS
- shared method iconForFileType(filetype as string) as NSImageMBS
- shared method isFilePackageAtPath(item as folderitem) as boolean
- shared method launchApplication(appname as string) as boolean
- shared method launchApplication(appname as string, showicon as boolean, autolaunch as boolean) as boolean
- shared method launchApplicationAtFile(file as folderitem, options as UInt32 = 0, configuration as dictionary = nil) as NSRunningApplicationMBS
- shared method launchApplicationAtFile(file as folderitem, options as UInt32, configuration as dictionary, byref error as NSErrorMBS) as NSRunningApplicationMBS
- shared method launchApplicationAtURL(URL as string, options as UInt32 = 0, configuration as dictionary = nil) as NSRunningApplicationMBS
- shared method launchApplicationAtURL(URL as string, options as UInt32, configuration as dictionary, byref error as NSErrorMBS) as NSRunningApplicationMBS
- shared method launchAppWithBundleIdentifier(bundleIdentifier as string, options as Integer = &h00030000, AppleEventDescriptor as Variant = nil) as Boolean
- shared method localizedDescriptionForType(typeName as string) as string
- shared method menuBarOwningApplication as NSRunningApplicationMBS
- shared method mountedLocalVolumePaths as string()
- shared method mountedRemovableMedia as string()
- shared method noteFileSystemChanged
- shared method noteFileSystemChanged(path as folderitem)
- shared method notificationCenter as NSNotificationCenterMBS
- shared method NSWorkspaceActiveSpaceDidChangeNotification as string
- shared method NSWorkspaceApplicationKey as string
- shared method NSWorkspaceCompressOperation as string
- shared method NSWorkspaceCopyOperation as string
- shared method NSWorkspaceDecompressOperation as string
- shared method NSWorkspaceDecryptOperation as string
- shared method NSWorkspaceDesktopImageAllowClippingKey as string
- shared method NSWorkspaceDesktopImageFillColorKey as string
- shared method NSWorkspaceDesktopImageScalingKey as string
- shared method NSWorkspaceDestroyOperation as string
- shared method NSWorkspaceDidActivateApplicationNotification as string
- shared method NSWorkspaceDidChangeFileLabelsNotification as string
- shared method NSWorkspaceDidDeactivateApplicationNotification as string
- shared method NSWorkspaceDidHideApplicationNotification as string
- shared method NSWorkspaceDidLaunchApplicationNotification as string
- shared method NSWorkspaceDidMountNotification as string
- shared method NSWorkspaceDidPerformFileOperationNotification as string
- shared method NSWorkspaceDidRenameVolumeNotification as string
- shared method NSWorkspaceDidTerminateApplicationNotification as string
- shared method NSWorkspaceDidUnhideApplicationNotification as string
- shared method NSWorkspaceDidUnmountNotification as string
- shared method NSWorkspaceDidWakeNotification as string
- shared method NSWorkspaceDuplicateOperation as string
- shared method NSWorkspaceEncryptOperation as string
- shared method NSWorkspaceLaunchConfigurationAppleEvent as string
- shared method NSWorkspaceLaunchConfigurationArchitecture as string
- shared method NSWorkspaceLaunchConfigurationArguments as string
- shared method NSWorkspaceLaunchConfigurationEnvironment as string
- shared method NSWorkspaceLinkOperation as string
- shared method NSWorkspaceMoveOperation as string
- shared method NSWorkspaceRecycleOperation as string
- shared method NSWorkspaceScreensDidSleepNotification as string
- shared method NSWorkspaceScreensDidWakeNotification as string
- shared method NSWorkspaceSessionDidBecomeActiveNotification as string
- shared method NSWorkspaceSessionDidResignActiveNotification as string
- shared method NSWorkspaceVolumeLocalizedNameKey as string
- shared method NSWorkspaceVolumeOldLocalizedNameKey as string
- shared method NSWorkspaceVolumeOldURLKey as string
- shared method NSWorkspaceVolumeURLKey as string
- shared method NSWorkspaceWillLaunchApplicationNotification as string
- shared method NSWorkspaceWillPowerOffNotification as string
- shared method NSWorkspaceWillSleepNotification as string
- shared method NSWorkspaceWillUnmountNotification as string
- shared method openFile(file as folderitem) as boolean
- shared method openFile(file as folderitem, appname as string) as boolean
- shared method openFile(file as folderitem, appname as string, Deactivate as boolean) as boolean
- shared method openURL(url as string) as boolean
- shared method openURL(url as string, bundleIdentifier as string, options as Integer = &h00030000, AppleEventDescriptor as Variant = nil) as Boolean
- shared method performFileOperation(operation as string, source as folderitem, destination as folderitem, files() as string, byref tag as Integer) as boolean
- shared method preferredFilenameExtensionForType(typeName as string) as string
- shared method selectFile(file as folderitem) as boolean
- shared method setDesktopImageURL(file as folderitem, screen as NSScreenMBS, options as dictionary, byref error as NSErrorMBS) as boolean
- shared method setIcon(image as NSImageMBS, file as folderitem, flags as Integer = 0) as boolean
- shared method setIcon(image as NSImageMBS, path as string, flags as Integer = 0) as boolean
- shared method showSearchResultsForQueryString(queryString as string) as boolean
- shared method typeOfFile(File as folderitem, byref error as NSErrorMBS) as string
- shared method typeOfFile(Path as string, byref error as NSErrorMBS) as string
- shared method unmountAndEjectDevice(item as folderitem, byref e as NSErrorMBS) as boolean
- shared method URLForApplicationToOpenURL(url as string) as string
- shared method URLForApplicationWithBundleIdentifier(bundleIdentifier as string) as string
- 20 constants
- const NSExclude10_4ElementsIconCreationOption = 4
- const NSExcludeQuickDrawElementsIconCreationOption = 2
- const NSWorkspaceLaunchAndHide = &h00100000
- const NSWorkspaceLaunchAndHideOthers = &h00200000
- const NSWorkspaceLaunchAndPrint = 2
- const NSWorkspaceLaunchAsync = &h00010000
- const NSWorkspaceLaunchDefault = &h00010000
- const NSWorkspaceLaunchInhibitingBackgroundOnly = &h00000080
- const NSWorkspaceLaunchNewInstance = &h00080000
- const NSWorkspaceLaunchWithErrorPresentation = &h00000040
- const NSWorkspaceLaunchWithoutActivation = &h00000200
- const NSWorkspaceLaunchWithoutAddingToRecents = &h00000100
Architectures
Constant | Value | Description |
---|---|---|
NSBundleExecutableArchitectureARM64 | &h0100000c |
Specifies the 64-bit ARM architecture. |
NSBundleExecutableArchitectureI386 | &h00000007 |
Intel 32 bit. |
NSBundleExecutableArchitecturePPC | &h00000012 |
PPC 32 bit. |
NSBundleExecutableArchitecturePPC64 | &h01000012 |
PPC 64 bit. |
NSBundleExecutableArchitectureX86_64 | &h01000007 |
Intel 64 bit. |
Authorization Types
Constant | Value | Description |
---|---|---|
NSWorkspaceAuthorizationTypeCreateSymbolicLink | 0 |
Authorization for the app to create a symoblic link. |
NSWorkspaceAuthorizationTypeReplaceFile | 2 |
Authorization for the app to perform an atomic file write without changing the target file's permissions. |
NSWorkspaceAuthorizationTypeSetAttributes | 1 |
Authorization for the app to change specific file attributes. |
This class has no sub classes.
Some examples using this class:
- /MacClassic/Using Mac OS Alias files
- /MacCocoa/Drop file to see icon parts
- /MacCocoa/Menu Test
- /MacCocoa/Notifications/NSWorkspaceMBS notification receiver
- /MacCocoa/NSAppleEventHandlerMBS test
- /MacCocoa/NSWorkSpace DropFile to see icon parts
- /MacCocoa/NSWorkSpace Notifications
- /MacControls/HTMLViewer Mac/WebDownloadDelegateMBS Test
- /MacExtras/iTunes Library/iTunes Library
- /MacFrameworks/MapKit/MapKit Custom Image
Blog Entries
- MBS Xojo Plugins, version 20.6pr1
- MonkeyBread Software Releases the MBS Xojo Plugins in version 20.2
- MBS Xojo Plugins, version 20.2pr6
- IconFamilyMBS class deprecated
- Custom menu checkmarks
- Adding custom icons for MacOS in Xojo
- Tip of the day: Windows Notifications
- MBS Real Studio Plugins, version 12.5pr3
- MBS Real Studio Plugins, version 11.3pr9
- MonkeyBread Software Releases the MBS REALbasic plug-ins 9.2
Xojo Developer Magazine
The items on this page are in the following plugins: MBS MacCocoa Plugin.
NSWorkspaceAuthorizationMBS - NSXPCConnectionMBS

Links
MBS Xojo Chart Plugins