0 votos

Error en los accesos directos de Siri - Estoy intentando ejecutar un Applescript que utiliza "Eventos del sistema"

Estoy intentando ejecutar un Applescript que centre la ventana con el foco. El acceso directo funciona bien, pero cuando intento utilizar el comando de voz con Siri se produce un error de "Evento del sistema", aparentemente Siri no tiene autorización de acceso.

Alguien ya ha visto este problema.

Screenshot showing the error.

Traducción del error del portugués al inglés: Lo siento, hubo un problema. Los accesos directos dicen: "Los eventos del sistema tienen un error: Shortcuts es un acceso asistencial no permitido".

0voto

On run {entrada, parámetros} dile a la aplicación "Finder" set screenSize a los límites de la ventana del escritorio set screenWidth to item 3 of screenSize set screenHeight to item 4 of screenSize end tell

tell application "System Events"
    tell dock preferences
        if screen edge is bottom then
            tell application "System Events" to tell process "Dock"
                set dockSize to size in list 1
                set dockHeight to item 2 of dockSize
                set screenHeight to (screenHeight - dockHeight)
            end tell
        else if screen edge is left then
            tell application "System Events" to tell process "Dock"
                set dockSize to size in list 1
                set dockHeight to item 1 of dockSize
                set screenWidth to (screenWidth + dockHeight)
            end tell
        else
            tell application "System Events" to tell process "Dock"
                set dockSize to size in list 1
                set dockHeight to item 1 of dockSize
                set screenWidth to (screenWidth - dockHeight)
            end tell
        end if
    end tell

    set screenHeight to (screenHeight + 22)
    set myFrontMost to name of first item of ¬
        (processes whose frontmost is true)
end tell

try
    tell application myFrontMost
        set windowSize to bounds of window 1
        set windowXl to item 1 of windowSize
        set windowYt to item 2 of windowSize
        set windowXr to item 3 of windowSize
        set windowYb to item 4 of windowSize

        set windowWidth to windowXr - windowXl
        set windowHeight to windowYb - windowYt

        if myFrontMost is "Terminal" then
            set bounds of window 1 to {¬
                round ((screenWidth - windowWidth) / 2) rounding as taught in school, ¬
                round ((screenHeight - windowHeight) / 2) rounding as taught in school, ¬
                round ((screenWidth + windowWidth) / 2) rounding as taught in school, ¬
                round ((screenHeight + windowHeight) / 2) rounding as taught in school}
        else
            set bounds of window 1 to {¬
                round ((screenWidth - windowWidth) / 2) rounding as taught in school, ¬
                round ((screenHeight - windowHeight) / 2) rounding as taught in school, ¬
                round ((screenWidth + windowWidth) / 2) rounding as taught in school, ¬
                round ((screenHeight + windowHeight) / 2) rounding as taught in school}
        end if

        set the result to bounds of window 1

    end tell
end try

return input

fin de carrera

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