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 |
- 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
Constants
Constant | Value | Description |
---|---|---|
NSExclude10_4ElementsIconCreationOption | 4 | One of the possible constants you can use with SetIcon. |
NSExcludeQuickDrawElementsIconCreationOption | 2 | One of the possible constants you can use with SetIcon. |
NSWorkspaceLaunchAndHide | &h00100000 | One of the constants for the launch functions. |
NSWorkspaceLaunchAndHideOthers | &h00200000 | One of the constants for the launch functions. |
NSWorkspaceLaunchAndPrint | 2 | One of the constants for the launch functions. |
NSWorkspaceLaunchAsync | &h00010000 | One of the constants for the launch functions. |
NSWorkspaceLaunchDefault | &h00010000 | One of the constants for the launch functions. |
NSWorkspaceLaunchInhibitingBackgroundOnly | &h00000080 | One of the constants for the launch functions. |
NSWorkspaceLaunchNewInstance | &h00080000 | One of the constants for the launch functions. |
NSWorkspaceLaunchWithErrorPresentation | &h00000040 | One of the constants for the launch functions. |
NSWorkspaceLaunchWithoutActivation | &h00000200 | One of the constants for the launch functions. |
NSWorkspaceLaunchWithoutAddingToRecents | &h00000100 | One of the constants for the launch functions. |
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.
Blog Entries
- MBS Xojo Plugins, version 23.2pr5
- MonkeyBread Software Releases the MBS Xojo Plugins in version 20.2
- MonkeyBread Software Releases the MBS Xojo Plugins in version 19.3
- IconFamilyMBS class deprecated
- Custom menu checkmarks
- Adding custom icons for MacOS in Xojo
- [ANN] MonkeyBread Software Releases the MBS Xojo / Real Studio plug-ins in version 14.4
- Tip of the day: Windows Notifications
- MonkeyBread Software Releases the MBS REALbasic plug-ins 9.2
- MonkeyBread Software Releases the MBS Plugins 8.1
Xojo Developer Magazine
Release notes
- Version 23.2
- Fixed memory leaks in fileLabelColors and fileLabels methods in NSWorkspaceMBS class.
- Version 21.0
- Added NSBundleExecutableArchitectureARM64 constant for NSBundleMBS and NSWorkspaceMBS classes.
- Version 20.2
- Added accessibility properties to NSWorkspaceMBS class.
- Version 19.3
- Added NSWorkspaceMBS.requestAuthorization method.
- Version 18.5
- Fixed FinderUpdateMBS for 64-bit to work by calling internally NSWorkSpaceMBS.noteFileSystemChanged.
Some examples using this class:
- /MacBase/Menus/Menu Test
- /MacClassic/Using Mac OS Alias files
- /MacCocoa/Drop file to see icon parts
- /MacCocoa/Notifications/NSWorkspaceMBS notification receiver
- /MacCocoa/NSAppleEventHandlerMBS test
- /MacCocoa/NSFileManager with authorization
- /MacCocoa/NSWorkSpace DropFile to see icon parts
- /MacCocoa/NSWorkSpace Icon Images
- /MacCocoa/NSWorkSpace Notifications
- /MacExtras/iTunes Library/iTunes Library
Some related classes:
- class Database
- class NSAppleEventHandlerMBS
- class NSBundleMBS
- class NSColorMBS
- class NSErrorMBS
- class NSImageMBS
- class NSNotificationCenterMBS
- class NSRunningApplicationMBS
- class NSScreenMBS
- class NSWorkspaceAuthorizationMBS
The items on this page are in the following plugins: MBS MacCocoa Plugin.
NSWorkspaceAuthorizationMBS - NSXPCConnectionMBS
