简体   繁体   中英

Change Dialog Box Text With AppleScript?

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!

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 .

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM