Previous Index Next

BridgePlus.framework, SMSForder Class Methods

Category

Miscellaneous methods

Method

passForGenericItem:account:error:

Summary

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.

Signature

+ (NSString *)passForGenericItem:(NSString *)itemName account:(NSString *)theAccount error:(NSError *__autoreleasing *)outError

Parameters

itemName = name of the keychain item

theAccount = account name in keychain item

outError = missing value or reference

Result

The password string

Availability

Version 1.3.0

Notes

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.

Sample

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"


Click here to open script in a script editor