• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Hiding user/password credentials in a script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hiding user/password credentials in a script


  • Subject: Re: Hiding user/password credentials in a script
  • From: Peter Baxter <email@hidden>
  • Date: Tue, 16 Sep 2008 08:18:07 +1000

Further on this, you will find that you are asked for the keychain password twice.  After that the script will not indicate that it is referring to a keychain.  You will need to create a key for the script in the keychain before trying this script.

tell application "Keychain Scripting"
set myTestPassword to the name of every key of keychain 1 whose name is "myTestPassword"
end tell
tell application "Keychain Scripting"
tell keychain 1
set chosenKey to the first generic key whose name is (myTestPassword as string)
set chosenPassword to the password of chosenKey
end tell
end tell
-- do something with your password
set the sourceString to the text returned of (display dialog " Enter your password" default answer "" with hidden answer)

if sourceString is in chosenPassword then
tell application "SystemUIServer" to display dialog "You have the correct password"
else
tell application "SystemUIServer" to display dialog "You have the wrong password"


end if


Show me the man who enjoys any part of Bolero whatever and I will travel a long way to have a look at him.

(John Harding)

Peter Baxter
email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Hiding user/password credentials in a script (From: "John C. Welch" <email@hidden>)
 >Re: Hiding user/password credentials in a script (From: Peter Baxter <email@hidden>)

  • Prev by Date: Re: Hiding user/password credentials in a script
  • Next by Date: Re: Illustrator position of selection
  • Previous by thread: Re: Hiding user/password credentials in a script
  • Next by thread: FileMaker Object Not Found Error
  • Index(es):
    • Date
    • Thread