SMAppServiceMBS methods

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

Back to SMAppServiceMBS class.

SMAppServiceMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Login Items MBS MacCF Plugin 23.0 ✅ Yes ❌ No ❌ No ❌ No All
The constructor.

An app service object that corresponds to the main application as a login item.
Use this SMAppServiceMBS to configure the main app to launch at login.

SMAppServiceMBS.register(byref error as NSErrorMBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Login Items MBS MacCF Plugin 23.0 ✅ Yes ❌ No ❌ No ❌ No All
Registers the service so it can begin launching subject to user approval.

The registration process applies to the following rules, depending upon the type of service:


If the service is already registered, this method returns kSMErrorAlreadyRegistered.
If the service isn’t approved by the user, this method returns kSMErrorLaunchDeniedByUser.

SMAppServiceMBS.unregister(byref error as NSErrorMBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Login Items MBS MacCF Plugin 23.0 ✅ Yes ❌ No ❌ No ❌ No All
Unregisters the service so the system no longer launches it.

error: Upon an unsuccessful return, a new NSError object describing the error. Upon successful return, this argument is nil. This argument may be NULL.

Returns true if the service was successfully unregistered; otherwise, false.

This is the opposite operation of register().
If the service corresponds to a LoginItem, LaunchAgent, or LaunchDaemon and the service is currently running it, the system terminates it. If the service corresponds to the main application, it continues running, but becomes unregistered to prevent future launches at login.
If the service is already unregistered, this method returns kSMErrorJobNotFound.

See also:

SMAppServiceMBS.unregister(CompleteHandler as SMAppServiceUnregisterCompletedMBS, tag as variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Login Items MBS MacCF Plugin 23.0 ✅ Yes ❌ No ❌ No ❌ No All
Unregisters the service so the system no longer launches it and calls a completion handler you provide with the resulting error value.

CompleteHandler: A completion handler to call with the result of the unregistration operation. Upon an unsuccessful return, the handler contains a new NSErrorMBS object describing the error. Upon successful return, this argument is nil.

See also:

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


💬 Ask a question or report a problem