0
我最近正在研究一个AppleScript项目,该项目需要将用户的密码复制到剪贴板供以后使用。我已经有了提示用户输入密码的部分,但是如何将返回的文本(他们的密码)设置到剪贴板。我当前的代码给我的错误:Can’t make text returned of «script» into type text.
这是我到目前为止有:如何将剪贴板设置为AppleScript返回的文本
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
do shell script "echo test" user name usr password pswd with administrator privileges
exit repeat
end try
end repeat
set a to (text returned) as list
set AppleScript's text item delimiters to linefeed
set a to a as text
set the clipboard to a