Function

SMLoginItemSetEnabled(_:_:)

Enable a helper application located in the main application bundle’s “Contents/Library/LoginItems” directory.

Declaration

func SMLoginItemSetEnabled(_ identifier: CFString, _ enabled: Bool) -> Bool

Parameters

identifier

The bundle identifier of the helper application bundle.

enabled

The Boolean enabled state of the helper application. This value is effective only for the currently logged in user. If true, the helper application will be started immediately (and upon subsequent logins) and kept running. If false, the helper application will no longer be kept running.

Return Value

Returns true if the requested change has taken effect.