目前坚持这一点。右键单击应用程序“Pro Tools”中的曲目名称可访问弹出菜单。我需要访问这个菜单。一段时间后,我想出了如何单击按钮上的所有其他弹出菜单,除了一个。脚本的第一部分是识别窗口的名称,因为它会根据项目而变化,但无论如何我已经包含了它。
其他按钮,例如:
pop up button "Playlist selector"
button "Track Record Enable"
button "TrackInput Monitor"
button "Solo"
button "Mute"
pop up button "Track View selector"
pop up button "Automation Mode selector"
pop up button "Track options"
一切正常。
唯一的区别是按钮的名称。
我需要的按钮在 UIElementInspector 中标识为
pop up button "Track name
\"Rhythm L\""
我相信这个问题是由于另一组中有 " " 的事实引起的。当我运行脚本时,它显示“预期行尾但找到标识符”
activate application "Pro Tools"
tell application "System Events"
# Get the frontmost app's *process* object.
set frontAppProcess to first application process whose frontmost is true
end tell
# Tell the *process* to count its windows and return its front window's name.
tell frontAppProcess
if (count of windows) > 0 then
set window_name to name of front window
end if
end tell
tell application "System Events" to tell process "Pro Tools"
click pop up button "Track name "Rhythm L "" of group "Rhythm L - Audio Track " of window window_name
end tell