• 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:OS 10.4.2: Keychain scripting "Application not running" error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:OS 10.4.2: Keychain scripting "Application not running" error


  • Subject: Re:OS 10.4.2: Keychain scripting "Application not running" error
  • From: Roy Whelden <email@hidden>
  • Date: Sun, 24 Jul 2005 14:10:52 -0700

John,
Here is a modification of that Keychain script mentioned earlier. I'm now using this on my own system.

-----
on startKeychainScripting()

    

    -- This function ensures that the Keychain Scripting.app is launched by a process
    -- different from the one executing this script. It is only needed when using Keychain Scripting to
    -- retrieve the password property of a key.

    

    -- Quit Keychain Scripting if it's running, since opening this script may have implicitly launched it.  
    try
        tell application "System Events"
            set foundApp to first process whose name is "Keychain Scripting"
            set pid to id of foundApp -- this will exit the try block if the process isn't running
            quit foundApp -- we get here if the process is found
        end tell
    end try

    

    -- get Finder to launch Keychain Scripting
    tell application "Finder"
        open application file ((startup disk as string) & "System:Library:ScriptingAdditions:Keychain Scripting") as alias
    end tell

    

    -- make sure that Keychain Scripting is up and running
    repeat while true
        try
            tell application "System Events"
                set foundApp to first process whose name is "Keychain Scripting"
                set pid to id of foundApp -- this will exit the try block if the process isn't running
            end tell
            exit repeat -- we get here if the process is found
        end try
    end repeat

    

end startKeychainScripting


startKeychainScripting()
tell application "Keychain Scripting"
    set allKeys to the name of every key of keychain 1
end tell
--Part 1:
set keyname to (choose from list allKeys)
set keyname to keyname as string
--Part 2:
tell application "Keychain Scripting"
    try
        set theKey to first key of current keychain whose name is keyname
        set thePassword to password of theKey
    on error message number errNum
        set thePassword to message & " (" & errNum & ")"
    end try
end tell
display dialog thePassword
----------


Roy Whelden

 _______________________________________________
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

  • Prev by Date: Re: file format backwards compatibility question
  • Next by Date: Re: how can script bundles store extra stuff?
  • Previous by thread: Re:OS 10.4.2: Keychain scripting "Application not running" error
  • Next by thread: Re: OS 10.4.2: Keychain scripting "Application not running" error
  • Index(es):
    • Date
    • Thread