Platforms to show: All Mac Windows Linux Cross-Platform
NSProcessInfoMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Process | MBS MacBase Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Each process has a single, shared NSProcessInfo object, known as process information agent.
The process information agent can return such information as the arguments, environment variables, host name, or process name. The processInfo class method returns the shared agent for the current process—that is, the process whose object sent the message. For example, the following line returns the NSProcessInfo object, which then provides the name of the current process:
Var processInfo as new NSProcessInfoMBS
Var processName as string = processInfo.processName
The NSProcessInfo class also includes the operatingSystem method, which returns an enum constant identifying the operating system on which the process is executing.
NSProcessInfo objects attempt to interpret environment variables and command-line arguments in the user's default C string encoding if they cannot be converted to Unicode as UTF-8 strings. If neither conversion works, these values are ignored by the NSProcessInfo object.
For Windows, please check WindowsThreadExecutionStateMBS to prevent system sleep.
- 21 properties
- property activeProcessorCount as Integer
- property argumentsCount as Integer
- property automaticTerminationSupportEnabled as boolean
- property environment as dictionary
- property globallyUniqueString as string
- property Handle as Integer
- property hostName as string
- property isiOSAppOnMac as Boolean
- property isLowPowerModeEnabled as Boolean
- property operatingSystem as Integer
- property operatingSystemName as string
- property operatingSystemVersionString as string
- property operationSystemVersionMajor as Integer
- property operationSystemVersionMinor as Integer
- property operationSystemVersionPatch as Integer
- property physicalMemory as UInt64
- property processIdentifier as Integer
- property processName as string
- property processorCount as Integer
- property systemUptime as Double
- property thermalState as Integer
- 10 methods
- method argument(index as Integer) as string
- method arguments as string()
- method beginActivity(options as Integer, reason as string) as NSProcessInfoActivityMBS
- method Constructor
- method disableAutomaticTermination(Reason as string)
- method disableSuddenTermination
- method enableAutomaticTermination(Reason as string)
- method enableSuddenTermination
- method endActivity(activity as NSProcessInfoActivityMBS)
- method operationSystemVersion(byref Major as Integer, byref Minor as Integer, byref Patch as Integer)
- 4 shared methods
- shared method NSActivityLatencyCritical as UInt64
- shared method NSProcessInfoPowerStateDidChangeNotification as String
- shared method NSProcessInfoThermalStateDidChangeNotification as String
- shared method processInfo as NSProcessInfoMBS
- 18 constants
Constants
Constant | Value | Description |
---|---|---|
NSHPUXOperatingSystem | 4 |
One of the following constants are provided by the NSProcessInfo class as return values for operatingSystem.
Indicates the HP UX operating system. |
NSMACHOperatingSystem | 5 |
One of the following constants are provided by the NSProcessInfo class as return values for operatingSystem.
Indicates the Mac OS X operating system. Example |
NSOSF1OperatingSystem | 7 |
One of the following constants are provided by the NSProcessInfo class as return values for operatingSystem.
Indicates the OSF/1 operating system. |
NSSolarisOperatingSystem | 3 |
One of the following constants are provided by the NSProcessInfo class as return values for operatingSystem.
Indicates the Solaris operating system. |
NSSunOSOperatingSystem | 6 |
One of the following constants are provided by the NSProcessInfo class as return values for operatingSystem.
Indicates the Sun OS operating system. |
NSWindows95OperatingSystem | 2 |
One of the following constants are provided by the NSProcessInfo class as return values for operatingSystem.
Indicates the Windows 95 operating system. |
NSWindowsNTOperatingSystem | 1 |
One of the following constants are provided by the NSProcessInfo class as return values for operatingSystem.
Indicates the Windows NT operating system. |
Activity Options
Constant | Value | Description |
---|---|---|
NSActivityAutomaticTerminationDisabled | &h8000 |
Flag to prevent automatic termination. Available in OS X v10.9 and later. |
NSActivityBackground | &h000000FF |
Flag to indicate the app has initiated some kind of work, but not as the direct result of user request. Available in OS X v10.9 and later. |
NSActivityIdleDisplaySleepDisabled | &h10000000000 |
Flag to require the screen to stay powered on. Available in OS X v10.9 and later. |
NSActivityIdleSystemSleepDisabled | &h100000 |
Flag to prevent idle sleep. This is included in NSActivityUserInitiatedAllowingIdleSystemSleep. Available in OS X v10.9 and later. |
NSActivitySuddenTerminationDisabled | &h4000 |
Flag to prevent sudden termination. This is included in NSActivityUserInitiatedAllowingIdleSystemSleep. Available in OS X v10.9 and later. |
NSActivityUserInitiated | &h00FFFFFF |
Flag to indicate the app is performing a user-requested action. Available in OS X v10.9 and later. |
NSActivityUserInitiatedAllowingIdleSystemSleep | &h00EFFFFF |
Flag to indicate the app is performing a user-requested action, but that the system can sleep on idle. Available in OS X v10.9 and later. |
Thermal State Constants
Constant | Value | Description |
---|---|---|
NSProcessInfoThermalStateCritical | 3 |
System performance is significantly impacted and the Mac needs to cool down. Recommendation: reduce application's usage of CPU, GPU, and I/O to the minimum level needed to respond to user actions. Consider stopping use of camera and other peripherals if your application is using them. |
NSProcessInfoThermalStateFair | 1 |
The system has reached a state where fans may become audible. |
NSProcessInfoThermalStateNominal | 0 |
No corrective action is needed. |
NSProcessInfoThermalStateSerious | 2 |
Fans are running at maximum speed, system performance maybe impacted. Recommendation: reduce application's usage of CPU, GPU and I/O, if possible. Switch to lower quality visual effects, reduce frame rates. |
This class has no sub classes.
Some examples using this class:
Blog Entries
- MonkeyBread Software Releases the MBS Xojo Plugins in version 24.1
- MBS Xojo Plugins, version 24.1pr1
- MBS Xojo Plugins, version 23.5pr5
- News from the MBS Xojo Plugins Version 21.3
- MonkeyBread Software Releases the MBS Xojo Plugins in version 21.3
- MBS Xojo Plugins, version 21.3pr2
- MBS Xojo Plugins Version 21.0 News
- MBS Xojo Plugins, version 21.0pr6
- MBS Xojo Plugins, version 18.5pr3
- MonkeyBread Software Releases the MBS REALbasic plug-ins 8.4
Xojo Developer Magazine
Release notes
- Version 24.1
- Added NSProcessInfoPowerStateDidChangeNotification for NSProcessInfoMBS class.
- Version 23.5
- Fixed isiOSAppOnMac and isLowPowerModeEnabled properties in NSProcessInfoMBS class to work in iOS target.
- Version 21.3
- Added isLowPowerModeEnabled property for NSProcessInfoMBS class.
- Version 21.0
- Added isiOSAppOnMac property for NSProcessInfoMBS class.
- Version 18.5
- Added NSProcessInfoMBS.operationSystemVersion method and properties.
The items on this page are in the following plugins: MBS MacBase Plugin.
NSProcessInfoActivityMBS - NSProgressIndicatorMBS
![The biggest plugin in space...](https://www.monkeybreadsoftware.de/images/xojoplugin.png)