更新。これは10.7.xで機能しますが、10.6にはles要素情報があります。
印刷シートのボタン(ドロップダウン)には、機能を説明する説明があります。
内アクセシビリティインスペクタ。これは、要素(ボタン)の上にマウスを置くと表示されます。cmd + F7でアクセシビリティインスペクターのビューをロックできます 。
説明はAXDescriptionとしてリストされます。

プリンタの例ではそのはあるプリンタプリセットのためにそれがあるプリセット
AXDescriptionがわかっている場合は、このようなものを使用して数字を回避できます。しかし、これが唯一の方法ではありません。ほんの一例です。
activate application "Preview"
tell application "System Events"
tell process "Preview"
click ((pop up buttons of sheet 1 of window 1) whose description is "Printers")
end tell
end tell
この例で上記が機能するには、「詳細を表示」とともに印刷シートが表示されている必要があります
ボタン/ドロップダウンにはメニューがあります。だから、あなたはを参照して、それを選択するか、クリックできるメニュー項目のメニューボタンの。
番号またはタイトル/ AXTitleを使用して。
activate application "Preview"
tell application "System Events"
tell process "Preview"
click ((pop up buttons of sheet 1 of window 1) whose description is "Presets")
click menu item "Last Used Settings" of menu of ((pop up buttons of sheet 1 of window 1) whose description is "Presets")
end tell
end tell
ボタンに変数を使用して呼び出すことで、繰り返しコードを短縮できます。以下の私の例のようにそれを行うとき;
activate application "Preview"
tell application "System Events"
tell process "Preview"
set Presets_button to item 1 of ((pop up buttons of sheet 1 of window 1) whose description is "Presets")
click Presets_button
click menu item "Last Used Settings" of menu of Presets_button
end tell
end tell
UI elements
:ここにも役立つからコマンドをn8henrie.com/2013/03/a-strategy-for-ui-scripting-in-applescript