Previous | Index | Next |
Miscellaneous methods
passForGenericItem:account:error:
Retrieves a generic keychain password. Searches all keychains, and returns the first match it finds.
Returns missing value if not found; check localizedDescription of error for explanation.
+ (NSString *)passForGenericItem:(NSString *)itemName account:(NSString *)theAccount error:(NSError *__autoreleasing *)outError
itemName = name of the keychain item
theAccount = account name in keychain item
outError = missing value or reference
The password string
Version 1.3.0
If you set outError to reference, the result will be a list of two items. If there is no error, the first item will be the result of the method and the second will be missing value. If there is an error, the first item will be missing value and the second item with be an NSError.
use scripting additions
use framework "Foundation"
use script "BridgePlus"
load framework
set {theResult, theError} to current application's SMSForder's passForGenericItem:"TesterName" account:"shane" |error|:(reference)
if theResult = missing value then error (theError's localizedDescription() as text)
ASify from theResult
--> "password"
theResult as text
--> "password"