Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSProcessInfoMBS class.

NSProcessInfoMBS.argument(index as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS MacBase Plugin 8.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the command-line argument for the process with the given index.
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

Some examples using this method:

NSProcessInfoMBS.arguments as string()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS MacBase Plugin 11.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the command-line arguments for the process.

Returns array of strings with the process's command-line arguments.

NSProcessInfoMBS.beginActivity(options as Integer, reason as string) as NSProcessInfoActivityMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS MacBase Plugin 13.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Begin an activity using the given options and reason.
Example
dim Activity as NSProcessInfoActivityMBS // property in your window, control, thread, app
dim AllowAppNap as boolean // allow or not?

dim ProcessInfo as NSProcessInfoMBS = NSProcessInfoMBS.processInfo
if AllowAppNap then
Activity = nil
else
// disable sleep to let us make something...
Activity = ProcessInfo.beginActivity(NSProcessInfoMBS.NSActivityBackground, "Backup running")
end if

options: Options for the activity. See constants for possible values.
reason: A string used in debugging to indicate the reason the activity began.

Returns an object token representing the activity.

Indicate completion of the activity by calling endActivity passing the returned object as the argument.
Available in OS X v10.9 and later.

For Windows, please check WindowsThreadExecutionStateMBS to prevent system sleep.

Some examples using this method:

NSProcessInfoMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS MacBase Plugin 12.4 ✅ Yes ❌ No ❌ No ✅ Yes All
The constructor.

NSProcessInfoMBS.disableAutomaticTermination(Reason as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS MacBase Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Decrement the counter tracking the number of automatic quit opt-out requests.

When this counter is greater than zero, the app will be considered 'active' and ineligible for automatic termination.
An example of using this would be disabling autoquitting when the user of an instant messaging application signs on, due to it requiring a background connection to be maintained even if the app is otherwise inactive.
Each pair of calls should have a matching "reason" argument, which can be used to easily track why an application is or is not automatically terminable.
A given reason can be used more than once at the same time (for example: two files are transferring over the network, each one disables automatic termination with the reason "file transfer in progress")

NSProcessInfoMBS.disableSuddenTermination

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Disables the application for quickly klling using sudden termination.

This method increments the sudden termination counter. When the termination counter reaches 0 the application allows sudden termination.

By default the sudden termination counter is set to 1. This can be overriden in your application Info.plist. See "Sudden Termination" for more information and debugging suggestions.

Available in Mac OS X v10.6 and later.

NSProcessInfoMBS.enableAutomaticTermination(Reason as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS MacBase Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Increment the counter tracking the number of automatic quit opt-out requests.

When this counter is greater than zero, the app will be considered 'active' and ineligible for automatic termination.
An example of using this would be disabling autoquitting when the user of an instant messaging application signs on, due to it requiring a background connection to be maintained even if the app is otherwise inactive.
Each pair of calls should have a matching "reason" argument, which can be used to easily track why an application is or is not automatically terminable.
A given reason can be used more than once at the same time (for example: two files are transferring over the network, each one disables automatic termination with the reason "file transfer in progress")

NSProcessInfoMBS.enableSuddenTermination

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Enables the application for quick killing using sudden termination.

This method decrements the sudden termination counter. When the termination counter reaches 0 the application allows sudden termination.

By default the sudden termination counter is set to 1. This can be overriden in your application Info.plist. See "Sudden Termination" for more information and debugging suggestions.

Available in Mac OS X v10.6 and later.

NSProcessInfoMBS.endActivity(activity as NSProcessInfoActivityMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS MacBase Plugin 13.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Ends the given activity.

activity: An activity object returned by beginActivity.
Available in OS X v10.9 and later.

Some examples using this method:

NSProcessInfoMBS.operationSystemVersion(byref Major as Integer, byref Minor as Integer, byref Patch as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS MacBase Plugin 18.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Queries operation system version.

One call to get all three parts.

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


The biggest plugin in space...