Re: OS 10.4.2: Keychain scripting "Application not running" error
Re: OS 10.4.2: Keychain scripting "Application not running" error
- Subject: Re: OS 10.4.2: Keychain scripting "Application not running" error
- From: Jeffrey Berman <email@hidden>
- Date: Mon, 25 Jul 2005 04:45:14 -0500
On 7/24/05 1:51 PM, Jolin M Warren wrote:
> Back in 10.4.0 and 10.4.1, I was having a problem accessing keychain
> passwords using Keychain Scripting that didn't cause problems under
> 10.3.x. This was apparently a bug.
>
> <http://lists.apple.com/archives/Applescript-users/2005/Jun/msg00596.html>
> <http://discussions.info.apple.com/webx?email@hiddennsJStM.1@.68addd0b>
>
> So I was excited to read in the release notes for 10.4.2 that this
> bug had been fixed.
>
>> Addresses a Keychain Scripting issue in which the "password"
>> property of a key often could not be retrieved.
>
> <http://docs.info.apple.com/article.html?artnum=301722>
>
> However, I installed the update yesterday and still get the same
> "Application not running" error when trying to use AppleScript to
> access a key's password in my default keychain. This is the same
> script that worked in 10.3.x. Has anyone else had any luck with
> Keychain Scripting in 10.4.2? Did my update not install properly, or
> is the bug still there?
Jolin:
Attached below is my modification of a solution posted in Apple's Knowledge
Base:
<http://docs.info.apple.com/article.html?artnum=301858>
I use this subroutine as a script that I then call from other scripts.
Thus, to get the password for a key named "test", the syntax would be:
get "path:to:get:password:script"
tell (load script file result) to GetPW for "test"
-Jeffrey Berman
----- Attachment follows -----
-- subroutine to ensure Keychain Scripting launched by process
-- different from one executing script when retrieving password.
-- (modified from fix posted in Apple Knowledge Base)
property KCPath : "System:Library:ScriptingAdditions:Keychain Scripting"
on GetPW for KeyName
tell application "System Events" to ¬
get application process "Keychain Scripting" exists
if result then tell application "Keychain Scripting" to quit
-- quit Keychain Scripting if running
get (path to startup disk as string) & KCPath
tell application "Finder" to open application file result
-- get Finder to launch Keychain Scripting
set timer to (current date) + 5
repeat
tell application "System Events" to ¬
get application process "Keychain Scripting" exists
if result then exit repeat
if (current date) > timer then ¬
error "Could not launch Keychain Scripting application."
end repeat
-- check that Keychain Scripting is up and running
tell application "Keychain Scripting" to return password of ¬
first key of current keychain whose name is KeyName
end GetPW
----- End of attachment -----
_______________________________________________
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