Re: Keychain Scripting for Program Linking doesn't work! (sometimes}
Re: Keychain Scripting for Program Linking doesn't work! (sometimes}
- Subject: Re: Keychain Scripting for Program Linking doesn't work! (sometimes}
- From: Harald E Brandt <email@hidden>
- Date: Mon, 18 Mar 2002 20:56:03 +0100
+--> Sander Tekelenburg wrote 02-03-17:
>
> Consider the block:
>
> tell application "Keychain Scripting"
>
> unlock keychain "Link" with password "blabla"
>
> quit
>
> end tell
>
>
>
> Often, especially when I am not looking (i.e it runs scheduled unattended
>
> during night) it puts up an annoying dialog for name and password of a key
>
> for program linking rather than open all the keys directly as it should!
>
> This bad behaviour of keychain has plagued me for months!
>
>
>
> What is wrong??
>
>
Dunno. But wrapping problem code in try blocks will allow you to at least
>
catch the error number and message:
+-
It already is in such a try block.
However, from the point of view of AppleScript, there is no failure - it simply just seems like it didn't open the program linking key, since when the script just thereafter wants to send a command to the remote finder, it (sometimes) throws up a prompt for password?
So, there are no error codes! That makes it a bit difficult for me to test and understand what is really going wrong. And again, it only happens sometimes. On really rare occasions, it has happened also when I have run my script "manually" (by doubleklicking the applet). If I run it again, the problem is gone!!?
I admit it sounds as if I don't know what I am doing - but I have really tried several variants for the last few months without a final definite solution. Right now (yesterday and the day before that) however, it has worked fine.
+--
>
> The keychain in question holds keys to three machines - one key each for
>
> AppleShare via AppleTalk and one key each for Program Linking. Why does it
>
> *sometimes* put up the dialog for name and password, whereas it works
>
> perfectly when I run the script (applet) from the keyboard??
>
> It is as if there is a timing problem - something is sleepy during night
>
> and the key doesn't get open! Extremely annoying and I don't know what to
>
> do about it!?
>
>
If 'sleepiness' is the problem, you might want to toy with your Energy Saver
>
settings. Or you might need to insert a small delay in your script. Or you
>
may need to have your script retry until successful:
+-
Other scripts and macros (QuicKeys) work fine during night. I have contemplated (but not yet tried) a delay. But how large is needed? Would that really be effective, since the normal delay halts computation of the whole machine (this is Mac OS 9)? Should it be inserted after the Keychain block?
+--
>
Have you tried putting it in a repeat, or an on idle block, to make it
>
attempt several times?
+-
If it gave error codes, that would have been doable, but now I have nothing that can trigger a repeated attempt!
The randomness of the problem makes it *extremely* difficult to test. What I wondered was if someone else has experienced the problem, and had a remedy. Sometimes I feel that it gets 'solved' for a few days if I recompile the script. When it goes into 'bad behavior' mode, then it is very likely to be bad also the next night! As if the password is stored in som flakey way(?) I'm sorry I can't be more precise in my symptom description...
Thanks for your attention and willingness to help.
__________________________BragIt___________________________
Harald E Brandt email@hidden
http://bragit.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.