首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >从Applescript设置弹出按钮值

从Applescript设置弹出按钮值
EN

Stack Overflow用户
提问于 2019-07-16 00:12:43
回答 2查看 579关注 0票数 0

我正在尝试使用applescript设置外部应用程序设置。我目前有

代码语言:javascript
复制
tell application "System Events"
     tell process "Pro Tools"
         click menu item "Save Copy In..." of menu "File" of menu bar 1
         tell pop up button 4 of window "Save Copy In..."
             click
             set value to "AIFF"
         end tell
      end tell
 end tell

但是在set value点上什么也没有发生。我们将非常感谢您的帮助!附件是我被困在的地方的截图。

EN

回答 2

Stack Overflow用户

发布于 2019-07-16 03:12:21

我想你只需要等到“保存副本在...”窗口出现。试试这段代码,它添加了一个查找窗口的延迟循环。

代码语言:javascript
复制
tell application "System Events"
    tell process "Pro Tools"
        tell menu bar 1's menu "File"
            click menu item "Save Copy In..."
        end tell

        repeat until (exists window "Save Copy In...")
            delay 0.1
        end repeat

        tell window "Save Copy In..."'s pop up button 4
            click
            -- the menu does not appear inthe PUB's view heirarchy until after it's clicked
            tell menu 1
                click menu item "AIFF" -- 'pick' should work too
            end tell
        end tell
    end tell
end tell
票数 1
EN

Stack Overflow用户

发布于 2019-07-16 02:32:58

尝试插入较短的延迟,以确保菜单可用,而不是设置value pick the menu item

代码语言:javascript
复制
tell application "System Events"
     tell process "Pro Tools"
         click menu item "Save Copy In..." of menu "File" of menu bar 1
         tell pop up button 4 of window "Save Copy In..."
             click
             delay 0.2
             pick menu item "AIFF" of menu 1
         end tell
      end tell
 end tell

命令pick没有文档,它是click的同义词。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57043601

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档