Platforms to show: All Mac Windows Linux Cross-Platform
Back to LoginItemsMBS class.
LoginItemsMBS.AddFile(file as FolderItem, hidden as boolean=false) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Login Items | MBS MacOSX Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Returns true on success.
For newer Mac OS X versions, please use LSSharedFileListMBS class instead.
LoginItemsMBS.AddURL(url as string, hidden as boolean=false) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Login Items | MBS MacOSX Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Returns true on success.
For newer Mac OS X versions, please use LSSharedFileListMBS class instead.
LoginItemsMBS.DisplayName(index as Integer) as String
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Login Items | MBS MacOSX Plugin | 7.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The display name may be localized.
LoginItemsMBS.File(index as Integer) as FolderItem
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Login Items | MBS MacOSX Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Index is from 0 to count-1.
LoginItemsMBS.IsHidden(index as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Login Items | MBS MacOSX Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Index is from 0 to count-1.
This value does not work in Mac OS X 10.4, but works in 10.5.
LoginItemsMBS.Name(index as Integer) as String
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Login Items | MBS MacOSX Plugin | 7.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This is the file name. To get the name for display, use displayname.
LoginItemsMBS.OldAddLoginItem(file as folderitem,hide as boolean,allusers as boolean) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Login Items | MBS MacOSX Plugin | 7.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This is the old method which edits the preferences file directly.
Do not use it unless you really need to. The new functions in this class handle login items using a system service and will be safer for future releases of Mac OS X.
hide matches the checkbox in the loginitems list.
allusers decides whether to set it for all user or the current one.
This function will add a LoginItem to the list of LoginItems when called. The properties given to the new LoginItem are passed when calling the function. Note that *no* check is made when adding the LoginItem to ensure that the path points to a valid application. Note that the LoginItem Is always added to the *end* of the list of LoginItems.
First Parameter (appfile):
The absolute path of the application to be launched expressed as a Xojo folderitem.
Second Parameter (hide):
A value representing if you want your application to be hidden at login time. True if you want the application to be hidden after it is launched. If you want the application to show up normally use be hidden use false.
Third Parameter (allusers):
A constant which represents which users preferences we want to change. In this case there are two alternatives: False which changes the preferences of the current user. The second alternative is True.
The kAllUsers LoginItems are launched for all users on the system. You must be root or admin to use the kAllUsers option.
Function Returns:
This function returns a boolean value representing if the function was successful.
The function returns true if the LoginItem was successfully added. False if otherwise. No additional error codes are returned.
Other Notes:
This code doesn't work properly if more than one application is attempting to write to the LoginItems preference at once.
Also no check is made to ensure that what you are adding to the LoginItem list isn't a duplicate. If there is a duplicate however only one instance of the application is launched.
LoginItemsMBS.OldCountOfLoginItems(allusers as boolean) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Login Items | MBS MacOSX Plugin | 7.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This is the old method which edits the preferences file directly.
Do not use it unless you really need to. The new functions in this class handle login items using a system service and will be safer for future releases of Mac OS X.
This function returns the number of LoginItems for the user requested as a signed integer.
LoginItemsMBS.OldLoginItemPropertyAtIndex(what as Integer, index as Integer, allusers as boolean) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Login Items | MBS MacOSX Plugin | 7.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This is the old method which edits the preferences file directly.
Do not use it unless you really need to. The new functions in this class handle login items using a system service and will be safer for future releases of Mac OS X.
Index is from 0 to count-1.
What can be 1 for the absolute path of the LoginItem, 2 for the LoginItem name or 3 for a string with "false" or "true" for the hiding option.
Returns "" on any error.
LoginItemsMBS.OldRemoveLoginItem(file as folderitem,allusers as boolean) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Login Items | MBS MacOSX Plugin | 7.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This is the old method which edits the preferences file directly.
Do not use it unless you really need to. The new functions in this class handle login items using a system service and will be safer for future releases of Mac OS X.
The items are compared by path.
Returns true if item was found and the new list is written correctly to disk.
allusers decides whether to set it for all user or the current one.
LoginItemsMBS.OldRemoveLoginItemAtIndex(index as Integer, allusers as boolean) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Login Items | MBS MacOSX Plugin | 7.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This is the old method which edits the preferences file directly.
Do not use it unless you really need to. The new functions in this class handle login items using a system service and will be safer for future releases of Mac OS X.
Index is from 0 to count-1.
LoginItemsMBS.Remove(index as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Login Items | MBS MacOSX Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Index is from 0 to count-1.
The count property is updated.
LoginItemsMBS.RemoveFile(file as FolderItem) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Login Items | MBS MacOSX Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Returns true on success.
Count is updated.
LoginItemsMBS.RemoveURL(url as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Login Items | MBS MacOSX Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Returns true on success.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Login Items | MBS MacOSX Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Update is done after each modification method and in the constructor.
You should never need to call this method.
LoginItemsMBS.URL(index as Integer) as String
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Login Items | MBS MacOSX Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Index is from 0 to count-1.
The items on this page are in the following plugins: MBS MacOSX Plugin.
