2013-06-27 30 views
0

我有此腳本如何讓AppleScript啓動sound.profPane?

tell application "System Preferences" 
    activate 
    set the current pane to pane id "com.apple.preference.sound" 
    reveal anchor "Output" of pane id "com.apple.preference.sound" 
end tell 

的問題是,它首先進入一般配置,所有這些圖標,只有到那時,它着重於聲音。這會產生一個快速而煩人的閃爍。我只對聲音窗格感興趣。

有沒有辦法,我可以寫一個腳本,只顯示沒有閃爍的聲音窗格?

謝謝!

回答

1

你可以使用直接的顯示命令:

tell application "System Preferences" 
    activate 
    reveal anchor "output" of pane id "com.apple.preference.sound" 
end tell 

如果您正在使用的用戶界面腳本,啓動命令,也可以留出:

tell application "System Preferences" 
    reveal anchor "output" of pane id "com.apple.preference.sound" 
end tell 
tell application "System Events" to tell process "System Preferences" 
    tell table 1 of scroll area 1 of tab group 1 of window 1 
     if selected of row 1 then 
      set selected of row 2 to true 
     else 
      set selected of row 1 to true 
     end if 
    end tell 
end tell 
+0

第一個腳本沒有通過語法檢查與AppleScript編輯器 – JasonGenX

+0

它適用於我在10.8和10.7。 – user495470

+0

這也適用於雪豹... +1 – adayzdone