簡體的時候都沒問題,切成繁體就抓不到設定裡的顯示器 主要是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