すみません。全然読み違いしていました。
こうですね。
set volumeoutput volume50
tellapplication"System Preferences"tosetcurrent panetopane"com.apple.preference.sound"
tellapplication"System Events"totellwindow1ofprocess"System Preferences"
clickradio button"出力"oftab group1
delay0.5
selectrow2oftable1ofscroll area1oftab group1
endtell
tellapplication"System Preferences"toquit
----------------------------------------------------
あと、システム環境設定が常に立ち上がっていても良いのなら、
上記の応用で現在のサウンド出力を取得できるので、
最初に私が書いたスクリプトを書き換えてこんな感じにできます。
repeat
tellapplication"System Preferences"tosetcurrent panetopane"com.apple.preference.sound"
tellapplication"System Events"totellwindow1ofprocess"System Preferences"
clickradio button"出力"oftab group1
seta1toselectedofrowsoftable1ofscroll area1oftab group1
repeatwitha2from1to10
if a1's item a2 is true then
set a3 to a2
exitrepeat
endif
endrepeat
seta5tovalueoftext field1ofrowa3oftable1ofscroll area1oftab group1
endtell
ifa5is"内蔵スピーカー"then
seta1tooutput volumeof (get volume settings)
ifa1 > 50thenset volumeoutput volume50
endif
delay1
endrepeat
これで出力が内蔵スピーカーの時にだけ、ボリュームが調整されるはずです。
でも常にウインドウを出しておくって、全然スマートじゃないんです。。
初期設定ファイルとかからとってくればもう少しスマートにできるかもしれません。
Fireface 400を別のUSB接続の物などに買い換えればこの問題は簡単にクリアできるんですけど、
もったいないですもんね。