Recibirá un error -1708 cada vez que haya elegido un AppleScript que no maneje el evento especificado.
Por ejemplo, si la secuencia de comandos sólo se ha implementado on message sent
, pero se establece esta secuencia de comandos para ejecutar cada vez que se recibe un mensaje, obtendrá un error -1708. Esto se debe a que el script solo sabe cómo manejar los mensajes salientes, no los entrantes, por lo tanto, Error -1708.
Ahora aquí es algo interesante ...
Si intenta utilizar el script por defecto para los eventos Mix Message Case.applescript
Message Received
, Message Received in Active Chat
y Message Sent
. El primero y el último funcionan bien, pero obtendrá un error -1708 para el evento de chat activo. Podemos deducir que esto significa que el script no está manejando el evento Message Received in Active Chat
. Y así parece que ni siquiera Apple puede manejar este evento en este momento.
OS X Mavericks Actualización:
Esta actualización corrige el error anteriormente mencionado. Si selecciona el script de muestra de Apple Speak Events.applescript, notará que maneja los mensajes recibidos a la sala de chat activa sin problemas. Si examina el código, notará que está utilizando el método on active chat message received
. Ahora podemos usar eso en nuestros guiones. Como ya no tengo instalada la versión anterior, no puedo probar si este mismo método funciona en la versión anterior.
Aquí está el código de Speak Events.applescript:
on active chat message received with eventDescription
say eventDescription
end active chat message received
Observe también cómo ya no se especifican los scripts individuales que se ejecutarán para eventos específicos. En su lugar, especifica un único controlador de scripts para los eventos de Mensajes. Esto significa que debe implementar todos los eventos para evitar obtener métodos -1708. Observe cómo en las secuencias de comandos de muestra, Apple incluso tiene el comentario # The following are unused but need to be defined to avoid an error
. Aquí es una plantilla que se puede utilizar como punto de partida para las escrituras:
using terms from application "Messages"
# The following are unused but need to be defined to avoid an error
on message sent theMessage with eventDescription
end message sent
on message received theMessage with eventDescription
end message received
on chat room message received with eventDescription
end chat room message received
on active chat message received with eventDescription
end active chat message received
on addressed message received theMessage from theBuddy for theChat with eventDescription
end addressed message received
on received text invitation with eventDescription
end received text invitation
on received audio invitation theText from theBuddy for theChat with eventDescription
end received audio invitation
on received video invitation theText from theBuddy for theChat with eventDescription
end received video invitation
on received local screen sharing invitation from theBuddy for theChat with eventDescription
end received local screen sharing invitation
on buddy authorization requested with eventDescription
end buddy authorization requested
on addressed chat room message received with eventDescription
end addressed chat room message received
on received remote screen sharing invitation with eventDescription
end received remote screen sharing invitation
on login finished with eventDescription
end login finished
on logout finished with eventDescription
end logout finished
on buddy became available with eventDescription
end buddy became available
on buddy became unavailable with eventDescription
end buddy became unavailable
on received file transfer invitation theFileTransfer with eventDescription
end received file transfer invitation
on av chat started with eventDescription
end av chat started
on av chat ended with eventDescription
end av chat ended
on completed file transfer with eventDescription
end completed file transfer
end using terms from
Si se comienza con este script y poner en práctica sólo los métodos que necesita (dejando intacto el resto), entonces usted debe evitar todo -1708 errores
¿Alguna vez descubrió esto? –
Jaja, el mismo problema aquí. AppleScript, un lenguaje con conceptos tan modernos pero con mensajes de error que te recuerdan los años ochenta. – Feuermurmel
El error dice "Evento no administrado" [Ref] (http://developer.apple.com/legacy/library/#documentation/Carbon/Reference/Apple_Event_Manager/Reference/reference.html), pero no puedo encontrar el evento para el mensaje recibido en el chat activo – drinchev