Getting the Keys of Plist Files

 

deleted
tell application "System Events"
	
	set pl to property list file "/Users/otto/Library/Preferences/com.apple.accounts.plist"
	
	name of property list items of pl
end tell

--{"devices", "ACOneTimeSMTPFixAccountSync", "ACOneTimeMigrateAccountSync", "ACOneTimeLDAPFixAccountSync"}
1 Like

Thank you. Yes, it’s really easier that way. And faster. I was thinking about System Events but didn’t realize that the key names and property list item names are the same thing. :grin:

Also, difference in the returned result is that my script returns some names starting with a small letter in its words. They are wrong… So, I will delete my script to not confuse users.