Quiero modificar el Applescript que utilizo para seleccionar la salida de sonido, para que también marque el volumen de salida al 100%.
(*
Applescript to toggle between two sound outputs by Line number, ¬
as they appear in the Sound Control Panel. Based on code by ¬
Arthur Hammer http://apple.stackexchange.com/a/209434/85275
*)
set internal to 1 --internal speakers
set batcave to 3 --Bat Cave
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.sound"
end tell
tell application "System Events"
tell application process "System Preferences"
repeat until exists tab group 1 of window "Sound"
end repeat
-- I added this line to dial the volume up to 100%
set volume output volume 1.0
tell tab group 1 of window "Sound"
click radio button "Output"
if (selected of row internal of table 1 of scroll area 1) then
set selected of row batcave of table 1 of scroll area 1 to true
else
set selected of row internal of table 1 of scroll area 1 to true
end if
end tell
end tell
end tell
--tell application "System Preferences" to quit
--remove the comment '--' tag above to make the control panel quit afterwards, leave for testing.
El error es:
tell current application
set volume «class pcap» "System Preferences" output volume 1.0
Result:
error "System Events got an error: Can’t make application process \"System Preferences\" into type small real." number -1700 from application process "System Preferences" to small real
Supongo que me faltan algunos comandos contextualizadores como "tell..." delante del comando "set column". ¿Sugerencias?
Estoy ejecutando MacOS 10.15.7 (Catalina)