Created
July 16, 2010 05:03
-
-
Save nall/477949 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run argv | |
set theServiceName to "SOMETHING HERE" | |
set theResult to "No Keychain entry found" | |
tell application "Keychain Scripting" | |
set isLocked to locked of current keychain | |
if (isLocked is true) then | |
unlock current keychain | |
end if | |
set allKeys to keys of current keychain | |
repeat with theKey in allKeys | |
if (class of theKey) is generic key then | |
if (service of theKey) is theServiceName then | |
set theResult to "Removed password from the keychain" | |
delete theKey | |
end if | |
end if | |
end repeat | |
if (isLocked is true) then | |
lock (name of current keychain) | |
end if | |
end tell | |
return theResult | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment