首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法使用AppleScript在Logic Pro X中获取弹出按钮的菜单(或菜单项)

无法使用AppleScript在Logic Pro X中获取弹出按钮的菜单(或菜单项)
EN

Stack Overflow用户
提问于 2019-08-16 16:19:51
回答 1查看 85关注 0票数 0

所以基本上我想写一个在Logic Pro X中启动一个插件的AppleScript,但即使在点击弹出按钮后,它也无法到达菜单(因此没有菜单项(插件)) this is the menu这里是我已经尝试过的,我找到了"Audio FX“弹出按钮在哪里,我可以点击它,但我想知道是否有任何方法可以到达它的菜单1?根据automator的watch-me-do,它应该在那里,但由于某种原因,我无法进入菜单

代码语言:javascript
运行
复制
tell application "Logic Pro X" to activate
tell application "System Events"
    tell process "Logic Pro X"
        set frontmost to true
        tell (first window whose subrole is "AXStandardWindow")
            tell group "Audio FX" of group 1 of group 1 of list 1 of list 1 of group 2
                tell pop up button 1
                    click
                    click menu item 3 of menu 1
                end tell
            end tell
        end tell
    end tell
end tell

所以我得到的错误是:

代码语言:javascript
运行
复制
error "System Events got an error: Can’t get menu 1 of pop up button 1 of group \"Audio FX\" of group 1 of group 1 of list 1 of list 1 of group 2 of window 1 of process \"Logic Pro X\" whose subrole = \"AXStandardWindow\". Invalid index." number -1719
EN

回答 1

Stack Overflow用户

发布于 2019-08-17 07:19:40

我同意@Ted Wrigley的评论,这可能是一个种族状况的问题。这样的东西可能对你有用。

代码语言:javascript
运行
复制
tell application "Logic Pro X" to activate
tell application "System Events"
    tell process "Logic Pro X"
        set frontmost to true
        tell (first window whose subrole is "AXStandardWindow")
            tell group "Audio FX" of group 1 of group 1 of list 1 of list 1 of group 2
                repeat while not (exists of pop up button 1)
                    delay 0.1
                end repeat
                tell pop up button 1
                    click
                    repeat while not (exists of menu item 3 of menu 1)
                        delay 0.1
                    end repeat
                    click menu item 3 of menu 1
                end tell
            end tell
        end tell
    end tell
end tell
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57521168

复制
相关文章

相似问题

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