Button 标识符有“&引用;名义上

Button 标识符有“&引用;名义上,button,applescript,identifier,Button,Applescript,Identifier,目前仍在坚持这一点。右键单击应用程序“Pro Tools”中的曲目名称可访问弹出菜单。我需要进入这个菜单。过了一段时间,我知道了如何在按钮上每隔一个弹出菜单单击一次。脚本的第一部分是确定窗口的名称,因为它会根据项目的不同而变化,但我还是包含了它 其他按钮,例如: pop up button "Playlist selector" button "Track Record Enable" button "TrackInput Monitor" button "Sol

目前仍在坚持这一点。右键单击应用程序“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\""
我相信这个问题是由另一组中有“”引起的。当我运行脚本时,它会显示“预期的行尾,但找到了标识符”


您需要对字符串中的引号进行转义,例如
“Track name\”thymth 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