右键单击桌面图标,然后单击菜单项

时间:2014-03-15 11:12:57

标签: macos applescript right-click

我可以使用以下脚本执行右键单击鼠标事件:

tell application "System Events" tell process "Finder" set target_index to 1 set target to image target_index of group 1 of scroll area 1 tell target to perform action "AXShowMenu" end tell end tell

但现在我想点击菜单项...让我们说"获取信息"那我怎么实现这个目标?任何线索?

1 个答案:

答案 0 :(得分:0)

tell application "System Events"
    tell process "Finder"
        set target_index to 1
        set target to image target_index of group 1 of scroll area 1
        tell target to perform action "AXShowMenu"
    end tell
    keystroke "Get Info" & return
end tell