Re: remember in keychain
Re: remember in keychain
- Subject: Re: remember in keychain
- From: "Mark J. Reed" <email@hidden>
- Date: Wed, 19 Dec 2007 16:58:01 -0500
What the heck is the shell command "periodic"?
On 12/19/07, Peter Baxter <email@hidden> wrote:
> It's not actually your computer's name. In System preferences, in
> Sharing, you can see your computer's name.
> Some UI scripting would get it.
>
> What you have here is a chicken and the egg problem. In this script
> you want the password that you don't know for a Host name you don't
> know either.
> I am concerned that, If it was possible to get both bits of this data
> in a script, you might have a security issue.
>
> you could alter your script to include this:
>
> tell application "Keychain Scripting"
> set allKeys to the name of every key of keychain 1
> choose from list allKeys --Lists all the keys for you
> set myKey to the result
> tell keychain 1
> set chosenKey to the first key whose name is myKey as string
> set adminpwd to the password of chosenKey as string
> end tell
> end tell
>
> On 19/12/2007, at 11:19 PM, tom evans wrote:
>
> > Many thanks for all your help on this - I think I understand what
> > the script will do. One problem - I can't find out what my
> > computer's sharing name is (what to put where you have
> > "MacintoshHome") I've tried a few possibilities, but none of them
> > work...
> >
> >
> > On 18 Dec 2007, at 19:23, Peter Baxter wrote:
> >
> >>>>
> >>
> >> I meant to have one extra line in there: myScript.
> >>
> >>
> >> tell application "Keychain Scripting"
> >> set myKey to "MacintoshHome"
> >> tell keychain 1
> >> set chosenKey to the first key whose name is myKey as string
> >> set adminpwd to the password of chosenKey as string
> >> end tell
> >> end tell
> >> set myScript to "do shell script {\"echo\" & quoted form of " &
> >> adminpwd & " | sudo periodic monthly ;echo 'Periodic tasks
> >> performed'\"}"
> >> myScript
> >>
> >> display dialog "The monthly, maintenance scripts have completed."
> >>
> >>
> >>
> >>
> >> Peter Baxter
> >> email@hidden
> >>
> >> Music creates order out of chaos: for rhythm imposes unanimity upon
> >> the divergent, melody imposes continuity upon the disjointed, and
> >> harmony imposes compatibility upon the incongruous.
> >> -- Yehudi Menuhin
> >>
> >> iChat 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
> >
>
>
--
Mark J. Reed <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