【问题标题】:Script to activate and enter details in System Dialog在系统对话框中激活和输入详细信息的脚本
【发布时间】:2021-10-26 02:26:56
【问题描述】:

我正在尝试编写一个可以在系统对话框中输入详细信息的脚本。但我无法访问它。有没有办法访问这个?我尝试获取所有系统对话框和警报的列表,但我仍然无法捕捉到这一点。

tell application "System Events" to ¬
  get name of every application process ¬
    whose role description of window 1 is "system dialog"

system dialog

【问题讨论】:

  • 所以我可以让那个系统对话框出现,你做了什么来提示那个系统对话框?
  • 我正在尝试使用 Xcode 在我的设备上运行应用程序
  • 您能否更明确和具体,以便我可以复制显示系统对话框,以便查看需要如何编码?
  • 抱歉含糊不清。所以我使用 Xcode 创建了一个 ios 应用程序,我想在我的 iphone 上运行它。在我的设备上安装应用程序之前,我会弹出这个窗口。
  • 感谢您的指导。在罗伯茨回答和您的评论的帮助下,我能够弄清楚。

标签: macos applescript


【解决方案1】:
tell application "SecurityAgent"
    activate
end tell
tell application "System Events"
tell process "SecurityAgent"
    set value of text field 1 of window 1 to "Username"
    set value of text field 2 of window 1 to "Password"
    click button "Allow" of window 1
end tell
end tell

【讨论】:

    【解决方案2】:

    我不确定以下是您要求的,但请尝试一下:

    tell application "System Events" to tell process "SecurityAgent"
        return name of every window
    end tell
    

    【讨论】:

      猜你喜欢
      • 2018-07-15
      • 1970-01-01
      • 2020-07-12
      • 1970-01-01
      • 2010-11-27
      • 2021-05-21
      • 1970-01-01
      • 2012-07-08
      • 1970-01-01
      相关资源
      最近更新 更多