Created
September 25, 2009 09:00
-
-
Save floehopper/193418 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
require 'osx/cocoa' | |
include OSX | |
OSX.load_bridge_support_file('/path/to/Security.bridgesupport') | |
def create_access(access_label) | |
err, myself = SecTrustedApplicationCreateFromPath(nil) | |
err, some_other = SecTrustedApplicationCreateFromPath('/Applications/Mail.app') | |
trusted_apps = NSArray.arrayWithObjects(myself, some_other, nil) | |
err, access = SecAccessCreate(access_label, trusted_apps) | |
return nil unless err == 0 | |
return access | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment