Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSProcessInfoMBS class.

NSProcessInfoMBS.activeProcessorCount as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 8.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Provides the number of active processing cores available on the computer.
Example
dim p as new NSProcessInfoMBS

MsgBox str(p.activeProcessorCount)

Available in Mac OS X v10.5 and later.
(Read only property)

Some examples using this property:

NSProcessInfoMBS.argumentsCount as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 8.4 ✅ Yes ❌ No ❌ No ✅ Yes All
The number of the command-line arguments.
Example
dim p as new NSProcessInfoMBS

dim i,c as Integer

c=p.argumentCount-1
for i=0 to c
MsgBox p.argument(i)
next

(Read only property)

Some examples using this property:

NSProcessInfoMBS.automaticTerminationSupportEnabled as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Marks the calling app as supporting automatic termination.

Without calling this or setting the equivalent Info.plist key (NSSupportsAutomaticTermination), the above methods (disableAutomaticTermination/enableAutomaticTermination) have no effect, although the counter tracking automatic termination opt-outs is still kept up to date to ensure correctness if this is called later. Currently, passing false has no effect.
This should be called during applicationDidFinishLaunching or earlier.
(Read and Write property)

NSProcessInfoMBS.environment as dictionary

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 8.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the variable names and their values in the environment from which the process was launched.
Example
dim p as new NSProcessInfoMBS
dim d as Dictionary = p.environment
MsgBox str(d.Count)

(Read only property)

NSProcessInfoMBS.globallyUniqueString as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 8.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a global unique identifier for the process.
Example
dim p as new NSProcessInfoMBS

MsgBox p.globallyUniqueString // shows for example "072EC09A-4825-11DD-BDC0-001D4F46F5E0-18405-00000CA853EB5B46"

Returns the Global ID for the process. The ID includes the host name, process ID, and a time stamp, which ensures that the ID is unique for the network.

This method generates a new string each time it is invoked, so it also uses a counter to guarantee that strings created from the same process are unique.
(Read only property)

Some examples using this property:

NSProcessInfoMBS.Handle as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 8.4 ✅ Yes ❌ No ❌ No ✅ Yes All
The internal reference to the NSProcessInfo object.

(Read and Write property)

NSProcessInfoMBS.hostName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 8.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the name of the host computer.
Example
dim p as new NSProcessInfoMBS

MsgBox p.hostName // for example "iMac.local"

(Read only property)

NSProcessInfoMBS.isiOSAppOnMac as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 21.0 ✅ Yes ❌ No ❌ No ✅ Yes All
A Boolean value that indicates whether the process is an iPhone or iPad app running on a Mac.

The value of this property is true only when the process is an iOS app running on a Mac. The value of the property is false for all other apps on the Mac, including Mac apps built using Mac Catalyst. The property is also false for processes running on platforms other than macOS.
(Read only property)

NSProcessInfoMBS.isLowPowerModeEnabled as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 21.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Retrieve the current setting of the system for the low power mode setting.

On systems where the low power mode is unknown or unsupported, the value returned from the lowPowerModeEnabled property is always false.
Returns true if low power mode is enabled for macOS 12 or iOS 9 and newer.
(Read only property)

Some examples using this property:

NSProcessInfoMBS.operatingSystem as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 8.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a constant to indicate the operating system on which the process is executing.
Example
dim p as new NSProcessInfoMBS

MsgBox str(p.operatingSystem) // shows 5 = NSMACHOperatingSystem

Operating system identifier. See "Constants" for a list of possible values. In Mac OS X, it's NSMACHOperatingSystem.
(Read only property)

Some examples using this property:

NSProcessInfoMBS.operatingSystemName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 8.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a string containing the name of the operating system on which the process is executing.
Example
dim p as new NSProcessInfoMBS

MsgBox p.operatingSystemName // shows "NSMACHOperatingSystem"

Operating system name. In Mac OS X, it's "NSMACHOperatingSystem"
(Read only property)

Some examples using this property:

NSProcessInfoMBS.operatingSystemVersionString as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 8.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a string containing the version of the operating system on which the process is executing.
Example
dim p as new NSProcessInfoMBS

MsgBox p.operatingSystemVersionString // "Version 10.5.4 (Build 9E17)"

Returns the Operating system version. This string is human readable, localized, and is appropriate for displaying to the user. This string is not appropriate for parsing.
(Read only property)

Some examples using this property:

NSProcessInfoMBS.operationSystemVersionMajor as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 18.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Queries major OS version.

(Read only property)

NSProcessInfoMBS.operationSystemVersionMinor as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 18.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Queries minor OS version.

(Read only property)

NSProcessInfoMBS.operationSystemVersionPatch as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 18.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Queries OS version patch level.

(Read only property)

NSProcessInfoMBS.physicalMemory as UInt64

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 8.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Provides the amount of physical memory on the computer.
Example
dim p as new NSProcessInfoMBS

MsgBox str(p.physicalMemory)

Available in Mac OS X v10.5 and later.
(Read only property)

Some examples using this property:

NSProcessInfoMBS.processIdentifier as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 8.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the identifier of the process.
Example
dim p as new NSProcessInfoMBS

MsgBox str(p.processIdentifier)

(Read only property)

NSProcessInfoMBS.processName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 8.4 ✅ Yes ❌ No ❌ No ✅ Yes All
The name of the process.
Example
dim p as new NSProcessInfoMBS

MsgBox p.processName

The process name is used to register application defaults and is used in error messages. It does not uniquely identify the process.

You can assign a new value, but:
User defaults and other aspects of the environment might depend on the process name, so be very careful if you change it. Setting the process name in this manner is not thread safe.
(Read and Write property)

Some examples using this property:

NSProcessInfoMBS.processorCount as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 8.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Provides the number of processing cores available on the computer.
Example
dim p as new NSProcessInfoMBS

MsgBox str(p.processorCount)

Available in Mac OS X v10.5 and later.
(Read only property)

NSProcessInfoMBS.systemUptime as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the how long it has been since the computer has been restarted.

Returns an NSTimeInterval indicating how long system the computer has been restarted.
Available in Mac OS X v10.6 and later.
(Read only property)

Some examples using this property:

NSProcessInfoMBS.thermalState as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS MacBase Plugin 15.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Retrieve the current thermal state of the system.
Example
dim n as NSProcessInfoMBS = NSProcessInfoMBS.processInfo

Select case n.thermalState
case n.NSProcessInfoThermalStateNominal
MsgBox "Thermal State: Nominal"
case n.NSProcessInfoThermalStateFair
MsgBox "Thermal State: Fair"
case n.NSProcessInfoThermalStateSerious
MsgBox "Thermal State: Serious"
case n.NSProcessInfoThermalStateCritical
MsgBox "Thermal State: Critical"
else
MsgBox "Thermal State: Unknown"
end Select

On systems where thermal state is unknown or unsupported, the value returned from the thermalState property is always NSProcessInfoThermalStateNominal.

Available in Mac OS X 10.10.3 and newer.
Returns -1 if function is called on older Mac OS X versions, Linux or Windows.
(Read only property)

Some examples using this property:

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


The biggest plugin in space...