Sunday, July 22, 2018

#1 2003-04-17 10:06:18 am

Ray Barber
Site Admin
From:: Lake Dallas, Texas
Registered: 2002-11-20
Posts: 348
Website

A little Keychain scripting

This script provides an example of Keychain scripting. From the AppleScript Users List.

OS version: OS X

Applescript:

set theShortUserName to do shell script "/usr/bin/whoami" --get the short
userid. This is how your default keychain is labled.

tell application "Keychain Scripting"
set myKeyChain to keychain theShortUserName
set theKeyList to every Internet key of myKeyChain --email keys are
normally Internet Keys
repeat with x from 1 to (length of theKeyList)
set theKey to item x of theKeyList
if the name of theKey is "name of key here" then
set thePassword to password of theKey --grab the password
set theUserID to the account of theKey --grab the userid
end if
end repeat
end tell


Ray Barber
Admin | MacScripter


Filed under: Keychain

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)