我試圖使用AppleScript單擊選擇框中的項目。使用AppleScript選擇組合框項目不會觸發項目動作
與標準的OSX文件選擇對話框打開鼠標手動點擊「更多...」的商品,但是當我嘗試做使用AppleScript,「更多...」的商品其顯示爲選擇框的選定項目,但不顯示對話框。
到目前爲止,我已經試過......(元素名稱從Automator的記錄來)
tell application "System Events"
click static text 1 of window 1 of application process "DYMO Word Addin"
-- combo box arrow
click UI Element 1 of combo box 2 of group 1 of window 1 of application process "DYMO Word Addin"
set labelsList to (list 1 of scroll area 1 of combo box 2 of group 1 of window 1 of application process "DYMO Word Addin")
set numLabelsInList to (count text fields of labelsList)
set theTextField to (text field numLabelsInList of labelsList)
if numLabelsInList > 1 then
repeat with z from 1 to (numLabelsInList - 1)
key code 125 -- down arrow
end repeat
end if
-- stuff I've tried
click theTextField
keystroke return
key code 36 -- return
set focused of theTextField to true
set value of attribute "AXFocused" of theTextField to true
perform action "AXConfirm" of theTextField
end tell
...現在我的想法。
這句話雖然從理論上回答這個問題, [這將是最好的](http://meta.stackexchange.com/q/8259)在這裏包括答案的基本部分,並提供鏈接供參考。 – user13500 2014-03-24 02:35:45