Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSWorkspaceMBS class.
NSWorkspaceMBS.NSWorkspaceWillSleepNotification as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | Cocoa | MBS MacCocoa Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Posted before the machine goes to sleep. An observer of this message can delay sleep for up to 30 seconds while handling this notification.
The notification object is the shared NSWorkspace instance. The notification does not contain a userInfo dictionary.
Available in Mac OS X v10.3 and later.
Some examples using this method:
NSWorkspaceMBS.NSWorkspaceWillUnmountNotification as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| shared method | Cocoa | MBS MacCocoa Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Posted when the Finder is about to unmount a device.
This notification will not be delivered if a volume was forcibly and immediately made unavailable, such as when a FireWire drive is simply unplugged, because there is no chance to deliver it before the volume becomes unavailable.
The notification object is the shared NSWorkspace instance. The userInfo dictionary contains a key "NSDevicePath" that returns the path where the device was mounted, as a string.
Available in Mac OS X v10.0 and later.
Some examples using this method:
The items on this page are in the following plugins: MBS MacCocoa Plugin.