使用 AppleScript 更改对话框文本?

发布于 2024-09-08 11:39:04 字数 527 浏览 6 评论 0原文

简单地说,是否可以更改 Apple 系统对话框中的“静态文本”字段?具体来说,我正在考虑更改密码弹出窗口的一些标签文本。我尝试通过 GUI 脚本使用 AppleScript:

tell application "System Events"
    try
        tell window 1 of process "loginwindow"
            repeat until not (value of static text 4 is equal to "")
                set value of static text 4 to "this is a test"
                delay 0.5
            end repeat
        end tell
    end try
end tell

尽管这似乎根本不起作用。还有其他方法吗?也许是脚本桥或其他?我不想从头开始编写自己的对话框(不是因为困难的原因,我可以轻松做到,我只是更喜欢接口而不是模拟。)

谢谢!

Simply, is it possible to change a "static text" field in an Apple system dialog box? Specifically I am looking into changing some label text of a password popup. I have tried using AppleScript via GUI scripting:

tell application "System Events"
    try
        tell window 1 of process "loginwindow"
            repeat until not (value of static text 4 is equal to "")
                set value of static text 4 to "this is a test"
                delay 0.5
            end repeat
        end tell
    end try
end tell

Although this does not seem to work at all. Any other methods? Perhaps Scripting Bridge or other? I'd prefer not to code my own dialogs from scratch (not for difficulty reasons, I could easily do it, I'd just prefer to interface rather than emulate.)

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

怎樣才叫好 2024-09-15 11:39:04

这是一个想法...我认为您不能更改登录窗口文本本身,但您可以更改登录窗口的背景图片。因此,您可以设置一些图像,然后在登录过程中使用这些图像来显示您想要的内容。

我从未尝试过,但这篇文章展示了如何做到这一点... 此处

Here's an idea... I don't think you can change the login window text itself but you can change the background picture of the login window. Therefore you may be able to setup some images, and then use those images during the login process to display what you want.

I never tried it but this post shows how to do this... here.

夏日浅笑〃 2024-09-15 11:39:04

经过大量研究,我不确定这是否可能 - 最好编写一个屏幕保护程序,实现它自己的密码保护,并允许从屏幕保护程序后面修改该对话框。

After much research, I'm not sure that this is possible - it would be best to write a screen saver, implement it's own password protection, and enable that dialog to be modified from behind the screen saver.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文