Platforms to show: All Mac Windows Linux Cross-Platform

Back to SCPreferencesMBS class.

SCPreferencesMBS.AddValue(key as CFStringMBS, value as CFObjectMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Adds data for a preference key.

This function associates new data with the specified key. In order to commit these changes to permanent storage a call must be made to CommitChanges.

Returns true if the value was added; false if the key already exists or if an error occurred.

SCPreferencesMBS.ApplyChanges as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Requests that the currently stored configuration preferences be applied to the active configuration.

Returns true if the lock was obtained; false if an error occurred.

SCPreferencesMBS.CommitChanges as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Commits changes made to the configuration preferences to persitent storage.

This function commits any changes to permanent storage. An implicit call to Lock/Unlock will be made if exclusive access has not already been established.

Note: This routine commits changes to persistent storage. Call ApplyChanges to apply the changes to the running system.

Returns true if the lock was obtained; false if an error occurred.

SCPreferencesMBS.Create(name as CFStringMBS, prefid as CFStringMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Initiates access to the per-system set of configuration preferences.

name: A string that describes the name of the calling process.
prefsID: A string that identifies the name of the group of preferences to be accessed/updated.

SCPreferencesMBS.CreateUniquePathChild(prefix as CFStringMBS) as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a new path component within the dictionary hierarchy.

prefix: A string that represents the parent path.
Returns a string representing the new (unique) child path; nil if the specified path does not exist.

SCPreferencesMBS.CreateWithAuthorization(name as CFStringMBS, prefid as CFStringMBS, AuthorizationHandle as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Initiates access to the per-system set of configuration preferences.

name: A string that describes the name of the calling process.
prefsID: A string that identifies the name of the group of preferences to be accessed/updated.
AuthorizationHandle: Handle to authorization object for root access.

SCPreferencesMBS.GetPathLink(path as CFStringMBS) as CFObjectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the link (if one exists) associated with the specified path.

path: A string that represents the path to be returned.
The dictionary associated with the specified path; nil if the path is not a link or does not exist.

SCPreferencesMBS.GetPathValue(path as CFStringMBS) as CFDictionaryMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the dictionary associated with the specified path.

path: A string that represents the path to be returned.
Returns the dictionary associated with the specified path; nil if the path does not exist.

Some examples using this method:

SCPreferencesMBS.GetValue(key as CFStringMBS) as CFObjectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the data associated with a preference key.

This function retrieves data associated with a key for the prefsID.

You could read stale data and not know it, unless you first call Lock.

Returns the value associated with the specified preference key; If no value was located, nil is returned.

SCPreferencesMBS.KeyList as CFArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns an array of currently defined preference keys.

Returns nil on any error.

Some examples using this method:

SCPreferencesMBS.Lock(wait as boolean) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Locks access to the configuration preferences.

This function obtains exclusive access to the configuration preferences associated with this prefsID. Clients attempting to obtain exclusive access to the preferences will either receive an kSCStatusPrefsBusy error or block waiting for the lock to be released.

wait: A boolean flag indicating whether the calling process should block waiting for another process to complete its update operation and release its lock.

Returns true if the lock was obtained; false if an error occurred.

SCPreferencesMBS.RemovePathValue(path as CFStringMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Removes the data associated with the specified path.

path: A string that represents the path to be returned.
Returns a boolean indicating the success (or failure) of the call.

SCPreferencesMBS.RemoveValue(key as CFStringMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Removes the data associated with a preference key.

This function removes the data associated with the specified key. In order to commit these changes to permanent storage a call must be made to CommitChanges.

Returns true if the value was removed; false if the key did not exist or if an error occurred.

SCPreferencesMBS.SetComputerName(name as CFStringMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Updates the computer/host name in the system preferences.

In order to commit these changes to permanent storage a call must be made to CommitChanges.
A call to ApplyChanges is also required for the new name to become active.
A boolean indicating the success (or failure) of the call.

SCPreferencesMBS.SetLocalHostName(name as CFStringMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Updates the local host name in the system preferences.

In order to commit these changes to permanent storage a call must be made to CommitChanges.

A call to ApplyChanges is also required for the new name to become active.

SCPreferencesMBS.SetPathLink(path as CFStringMBS, link as CFObjectMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Associates a link to a second dictionary at the specified path.

path: A string that represents the path to be updated.
link: A string that represents the link to be stored at the specified path.
Returns a boolean indicating the success (or failure) of the call.

SCPreferencesMBS.SetPathValue(path as CFStringMBS, value as CFDictionaryMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Associates a dictionary with the specified path.

path: A string that represents the path to be updated.
value: A dictionary that represents the data to be stored at the specified path.
Returns a boolean indicating the success (or failure) of the call.

SCPreferencesMBS.SetValue(key as CFStringMBS, value as CFObjectMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Updates the data associated with a preference key.

This function adds or replaces the value associated with the specified key. In order to commit these changes to permanent storage a call must be made to CommitChanges.

Returns true if the value was set; false if an error occurred.

SCPreferencesMBS.Signature as CFBinaryDataMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a sequence of bytes that can be used to determine if the saved configuration preferences have changed.

A CFBinaryDataMBS that reflects the signature of the configuration preferences at the time of the call to Create.

SCPreferencesMBS.Unlock as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SystemConfiguration MBS MacCF Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Releases exclusive access to the configuration preferences.

This function releases the exclusive access "lock" for this prefsID. Other clients will be now be able to establish exclusive access to the preferences.

Returns true if the lock was obtained; false if an error occurred.

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


The biggest plugin in space...