2011-05-05 9 views
5

Recibo este error cada vez que ejecuto este script: Eventos del sistema tienen un error: "Test123" no entiende el mensaje de notificación.AppleScript: identificador de llamadas dentro de la instrucción tell

Código:

--more code... 
tell application "System Events" 
    if some_system_events_property then 
     my notify of "Test123" thru "Test" 
    end if 
end tell 
--more code... 
to notify of message thru level 
    display dialog message with titel level 
end notify 

he tratado de sustituir

my notify of "Test123" thru "Test" 

con lo siguiente, sin ningún éxito:

notify of "Test123" thru "Test" of me 
(notify of "Test123" thru "Test") of me 
+0

¿Qué es esto 'de "Test123" a través de "Prueba"'? Eso no tiene sentido – mcgrailm

Respuesta

3

Prueba esto:

tell application "System Events" 
    if some_system_events_property then 
     tell me to notify of "Test123" thru "Test" 
    end if 
end tell 

to notify of message thru level 
    display dialog message with title level 
end notify 

Aunque también voy a decir que yo nunca uso la sintaxis directo de parámetros para los manipuladores de AppleScript, prefiriendo los parámetros de posición (es decir, notify(message, level)), ya que evita los problemas de sintaxis ambiguas tu descubriste

3

no exactamente seguro de lo que estás tratando de hacer, pero aquí es un ejemplo de cómo llamar a una función y pasar el parámetro

tell application "System Events" 
    set m to "message content" 
    my notify(m) 
end tell 
--more code... 
on notify(message) 
    display dialog (message) 
end notify 
Cuestiones relacionadas