Delete Keychain Login

Hi

I’m trying to write a script that users can delete their Keychain Login and they can then choose to Delete the Files and references manually if they wish.

I have the following so far but i must be missing some thing because its not working. Please can someone have a look and point me in the right direction.

Thank you

tell application “Keychain Access”
activate
end tell
tell application “System Events”
tell process “Keychain Access”
click the menu item “Delete Keychain login” of menu bar “File” of menu bar 2
end tell
end tell

this works on my machine


activate application "Keychain Access"
tell application "System Events"
	tell process "Keychain Access"
		click menu item "Delete Keychain "login"" of menu 1 of menu bar item "File" of menu bar 1
	end tell
end tell

Thanks again this works great

Excellent, this is just what I’ve been after too! When I try to run the script thought I get a message saying “Expected end of line but found identifier”

The word login of the line “click menu item “Delete Keychain “login”” of menu 1 of menu bar item “File” of menu bar 1” is hight lighted.

I guess it’s something to do with the speech marks but they look ok to me…

Thanks for any help, Kev