使用 Applescript 添加用户身份验证
我想在我的 applescript 中添加用户身份验证来执行某些任务。如果用户名和密码正确,则只应执行下一个任务。如何使用 applescript 来做到这一点?
I want to add user authentication in my applescript to perform some task. If the username and password is correct then only the next task should happen. How to do this using applescript?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你还没有真正说出你想要多少安全性。
最基本的解决方案:
将其另存为只读脚本,这样可以防止临时用户查看脚本的内容,但如果有人真的想突破您的保护,这根本不安全。
You haven't really said how much security you want.
The most basic of solutions:
Save it as a read-only script and it'll prevent casual users from looking at the contents of the script, but this is not really secure at all if someone really wants to break through your protection.
如果您的 Mac 运行的是 Leopard (Mac OS X 10.5+),那么您可以使用
system info
命令的长用户名
属性,该属性返回系统的全名当前用户。话虽如此,你可以这样做......如果你有任何疑问,请问我:)
If your Mac is running Leopard (Mac OS X 10.5+), then you could use the
long user name
property of thesystem info
command, which returns the full name of the current user. Having said that, you could do this...If you have any questions, just ask me :)
如果您需要输入用户名和密码,请使用以下命令:
If you are wanting a username and password input then use this: