1 votos

Desplegable seleccione Ajuste de AppleScript

Estoy tratando de habilitar dictado con applescript y hasta ahora tienen los siguientes que funciona.
Pero, ¿Cómo configuro la caída de la tecla de método abreviado mediante AppleScript?

enter image description here

A continuación es el código de AppleScript:

tell application "System Preferences"
reveal pane id "com.apple.preference.speech"

tell application "System Events"
    tell process "System Preferences"
        tell window "Dictation & Speech"
            tell tab group 1
                click radio button "Dictation"
                tell radio group 1
                    if value of radio button "On" is 0 then
                        click radio button "On"

                    end if
                end tell
            end tell
            if sheet 1 exists then
                tell sheet 1
                    click button "Enable Dictation"
                    repeat while sheet 1 exists
                    end repeat
                end tell
            end if
        end tell
    end tell
end tell
quit -- optional
end tell

2voto

Malik hassan Puntos 16

El uso de la cáscara de los valores Predeterminados de comando en un Applescript Do shell script parece que funciona bien para mí. Esto le ahorrará GUI de secuencias de comandos de problemas.

El script lee primero el archivo de preferencias. Luego se pone al frente de su Bool.

set dictionToggle to (do shell script " defaults read ~/Library/Preferences/com.apple.assistant.support \"Dictation Enabled\" ") as integer

do shell script "defaults write  ~/Library/Preferences/com.apple.assistant.support \"Dictation Enabled\" -bool " & (not (dictionToggle as boolean)) as Unicode text

Yo siempre copia de seguridad de los archivos de preferencia usando el menú contextual comprimir "...." para hacer un comprimido de copia de la misma.

enter image description here

El archivo com.apple.assistant.apoyo.plist que se cambia se encuentra en la carpeta de preferencias

/Usuarios/nombre de Usuario/Librería/Preferences/com.apple.assistant.apoyo.plist


Si usted tiene que usar interfaz gráfica de usuario de secuencias de comandos especialmente si desea cambiar el atajo de teclado. ( y ya que no puedo ser Ars... para averiguar que uno de los simbólica tecla de acceso directo de configuración en la com.apple.symbolichotkeys.plist es la de la derecha)

Entonces esto debería funcionar. (como se hace en mi Mac, al menos :-) )

  set off to 1
set fnTwice to 3
set rightCommandTwice to 4
set leftCommandTwice to 5
set eitherCommandTwice to 6


tell application "System Preferences"
    activate
    set current pane to pane "com.apple.preference.speech"
    reveal (first anchor of current pane whose name is "Dictation") 
end tell
tell application "System Events"

    tell application process "System Preferences"
        set theGroup to tab group 1 of window "Dictation & Speech"
        click radio button "On" of radio group 1 of theGroup

        try
            click button "Enable Dictation" of sheet 1 of window "Dictation & Speech"
        end try
        set thePopUp to pop up button 2 of theGroup
        click thePopUp
        click menu item fnTwice of menu 1 of thePopUp
    end tell
end tell
tell application "System Preferences"
    --quit
end tell

AppleAyuda.com

AppleAyuda es una comunidad de usuarios de los productos de Apple en la que puedes resolver tus problemas y dudas.
Puedes consultar las preguntas de otros usuarios, hacer tus propias preguntas o resolver las de los demás.

Powered by:

X