Keychain problems

I have a script that I’m using to access my keychain. It used to work, but now it doesn’t. I searched the forums and the solutions I found didn’t work. I’m using Tiger 10.4.5
Here’s what I’ve tried:


tell application "Keychain Scripting"
	launch
	tell current keychain
		tell (some generic key whose name is "AS_Allow")
			-- this is the problem line:
			set PWD to password
		end tell
	end tell
end tell

and


get_password_from_keychain()
on get_password_from_keychain()
	tell application "Keychain Scripting"
		-- both of these two lines don't work:
		set k to get key 1 of keychain 1 whose name is "AS_Allow"
		tell k to set pt_password to password
	end tell
	return pt_password
end get_password_from_keychain

Model: Powerbook G4
AppleScript: AppleScript 1.10.3
Browser: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.2) Gecko/20060311 Camino/1.0.0+
Operating System: Mac OS X (10.4)

Your first version works for me and is identical to the script I use (my general purpose key for AppleScript has a different name, however). So does my handler for it (tests made running 10.4.5 fully updated):


to getPassw()
	tell application "Keychain Scripting"
		launch
		tell current keychain to ¬
			tell (some generic key whose name is "applescriptAllow")
				return password
			end tell
	end tell
end getPassw

getPassw()

Given that the code works, the problem is with your Keychain entry which must have become corrupt. I’ve had that problem occasionally too - just delete the old AS_Allow entry in your keychain and recreate it and all should be working again.

This script works pretty well…
…but alas, KeyChain Scripting doesn’t seem to value the access settings of the keychain item.
It repeatedly keeps asking for the keychain access - even while the item is set to “Allow access to all applications”.
More annoyingly, it changes that access setting back into “Confirm before allowing access”, as you can verify in the “Access Control” pane in Keychain Access - thereby spoiling any other app’s free access to that keychain item.

Is this a bug…?

(Both on 10.4.6 PPC, 10.4.8 Intel)

I found the same bug (?) on Intel 10.4.9
In my case it’s an AppleScript Studio application.

Quite annoyning…

:o:mad::o

I looked into this further and improvement was made by cleaning my rubbished keychain (70+ items, some dated back to 2002).
Now, my Airport key is recognized again and Applescript key sticks again