简体的时候都没问题,切成繁体就抓不到设定里的显示器 主要是19行一直抓不到,请大大解惑 手机截图请见谅 https://i.imgur.com/1IcBDgB.jpeg on findLastTargetIndex(targetItem, itemList) set lastIndex to 0 repeat with i from (count of itemList) to 1 by -1 if item i of itemList is targetItem then set lastIndex to i exit repeat end if end repeat return lastIndex end findLastTargetIndex beep 1 beep 1 tell application "System Settings" activate delay 1 tell application "System Events" tell process "System Settings" click menu item "显示器" of menu "显示" of menu bar it em "显示" of menu bar 1 delay 0.3 tell group 1 of group 2 of splitter group 1 of group 1 of window "显示器" try click pop up button "添加" delay 0.3