For Automation I can use tccutil to reset the information with
sudo tccutil reset AppleEvents
But how do I do that for the Login Items? I found a Terminal command at How-to: Reset Privacy Permissions in macOS | Recoursive on how to find all possible service names. But I don’t see anything for Login Items there.
If you want to remove them all from within a Xojo app, this will do the trick.
// Get login items list
dim l as new LSSharedFileListMBS(LSSharedFileListMBS.kSessionLoginItems)
// Get items from the list
dim items() as LSSharedFileListItemMBS = l.Snapshot
// Remove all items (it seems like the references to the items are broken when one is removed, so a new snapshot is needed each time)
do until items.Ubound = -1
l.Remove items(0)
items = l.Snapshot
loop
Thanks, Jared, but this is the wrong section. The LSShared items are in the upper section and I want to reset the lower section:
There is no minus for the lower section.
But I was wrong, too. The Login Items are in General and not in Privacy & Security. So I don’t think that tccutil is correct here.