문제

I have recently been working on a project that requires the user's password to be copied to the clipboard. I have this much:

set usr to short user name of (system info)
repeat
    display dialog "Please enter login password to continue:" default answer "" buttons {"Submit"} with title "Enter password" with icon stop with hidden answer
    set pswd to text returned of the result
    try
        set a to do shell script "echo test" user name usr password pswd with administrator privileges
        exit repeat
        end try
end repeat
set the clipboard to a

However, the clipboard simply sets to "test," presumably from where it says "echo test"

How do I fix this problem to set the password entered to the clipboard?

도움이 되었습니까?

해결책

Try:

set the clipboard to pswd
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top