所以基本上我想写一个在Logic Pro X中启动一个插件的AppleScript,但即使在点击弹出按钮后,它也无法到达菜单(因此没有菜单项(插件)) this is the menu这里是我已经尝试过的,我找到了"Audio FX“弹出按钮在哪里,我可以点击它,但我想知道是否有任何方法可以到达它的菜单1?根据automator的watch-me-do,它应该在那里,但由于某种原因,我无法进入菜单
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所以我得到的错误是:
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发布于 2019-08-17 07:19:40
我同意@Ted Wrigley的评论,这可能是一个种族状况的问题。这样的东西可能对你有用。
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 tellhttps://stackoverflow.com/questions/57521168
复制相似问题