目前坚持这一点。右键单击“ 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