Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- — Zustand von Systemeinstellungen sichern
- set sysPrefsWasRunningBefore to application „System Preferences“ is running
- if sysPrefsWasRunningBefore then
- tell application „System Preferences“ to set prevSysPrefPane to current pane
- else
- tell application „System Preferences“ to run
- end if
- — Soundeinstellungen aufrufen
- tell application „System Preferences“ to set current pane to pane „com.apple.preference.sound“
- — Auswahlfenster zeigen
- display dialog „Sounddevice“ buttons {„Headset“, „iMac“} default button 1 with icon 2
- — wenn „Headset“ gewählt wurde, dann diese Schleife
- if button returned of result is „Headset“ then
- tell application „System Events“ to tell application process „System Preferences“
- tell window 1 to tell tab group 1
- delay 1
- click radio button „Ausgabe“
- tell table 1 of scroll area 1
- select row 2
- end tell
- end tell
- end tell
- delay 1
- tell application „System Events“ to tell application process „System Preferences“
- tell window 1 to tell tab group 1
- delay 1
- click radio button „Eingabe“
- tell table 1 of scroll area 1
- select row 2
- end tell
- end tell
- end tell
- — Ende der Schleife wenn „Headset“ gewählt wurde
- else if button returned of result is „iMac“ then
- — wenn „iMac“ gewählt wurde, dann diese Schleife
- tell application „System Events“ to tell application process „System Preferences“
- tell window 1 to tell tab group 1
- delay 1
- click radio button „Ausgabe“
- tell table 1 of scroll area 1
- select row 1
- end tell
- end tell
- end tell
- delay 1
- tell application „System Events“ to tell application process „System Preferences“
- tell window 1 to tell tab group 1
- delay 1
- click radio button „Eingabe“
- tell table 1 of scroll area 1
- select row 1
- end tell
- end tell
- end tell
- — Ende der Schleife wenn „iMac“ gewählt wurde
- end if
- — Zustand von Systemeinstellungen wiederherstellen wie vorher
- if sysPrefsWasRunningBefore then
- try
- tell application „System Preferences“ to set current pane to prevSysPrefPane
- end try
- else
- tell application „System Preferences“ to quit
- end if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement