Re: do shell script
Re: do shell script
- Subject: Re: do shell script
- From: Stephen Jonke <email@hidden>
- Date: Wed, 16 Feb 2005 14:55:55 -0500
On Feb 16, 2005, at 2:40 PM, Doug McNutt wrote:
Sounds like a security flaw to me. Is there a better way to define the
variable than as a property?
Use the keychain to store the password. Here's a simple example
presuming you have the password in your keychain with the name "Some
Key Name" (you can manually create a password entry in the keychain
with the Keychain Access program in the Utilities folder):
tell application "Keychain Scripting"
tell keychain 1
unlock
set theKey to first key whose name is "Some Key Name"
set theUsername to (account of theKey) as string
set thePassword to (password of theKey) as string
end tell
end tell
Regarding the command "unlock": if the keychain is already unlocked
this will do nothing and pass through. If the keychain is locked, the
user will be presented with the usual keychain unlocking dialog to
unlock it.
Obviously "theUsername", "thePassword" and "theKey" should not be
properties! You can also, of course, specify the keychain by name
instead of number.
A more sophisticated approach would be to have the program prompt for
the password and create/update the keychain entry if it doesn't already
exist or is wrong. Also I'm sure you'll want some error checking in
there, but this will give you the idea.
Steve
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden