我正在尝试使用applescript设置外部应用程序设置。我目前有
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
点上什么也没有发生。我们将非常感谢您的帮助!附件是我被困在的地方的截图。
发布于 2019-07-16 03:12:21
我想你只需要等到“保存副本在...”窗口出现。试试这段代码,它添加了一个查找窗口的延迟循环。
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
发布于 2019-07-16 02:32:58
尝试插入较短的延迟,以确保菜单可用,而不是设置value
pick
the menu item
。
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
的同义词。
https://stackoverflow.com/questions/57043601
复制相似问题