Previous Index Next

BridgePlus.framework, SMSForder Class Methods

Category

Miscellaneous methods

Method

passForGenericItem:account:keychainPath:error:

Summary

Retrieves a generic keychain password from the keychain at the specified path. Returns the first match.

Returns missing value if not found; check localizedDescription of error for explanation.

Signature

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

Parameters

itemName = name of the keychain item

theAccount = account name in keychain item

keychainPath = path to the keychain to use

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" keychainPath:"/Users/shane/Desktop/Test.keychain" |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