这个Applescript有什么问题?
我的应用程序具有一些基本的可用性。有一个方法(receivedInstantMessage)接受一个参数(消息)并将其传递给我的应用程序然后处理它。
以下AppleScript:
tell application "MyApp"
receivedInstantMessage "This is a message"
end tell
完美的工作。我的应用程序显示一个包含消息的对话框(“这是一条消息”)。
我正在尝试设置它,以便当我向iChat发送IM时,它会运行一个AppleScript,将消息的内容发送到我的应用程序。我告诉iChat在收到消息时运行脚本,我知道该部分正在运行。我现在使用的脚本不起作用:
using terms from application "iChat"
on message received theMessage from theBuddy for theChat
tell application "MyApp"
receivedInstantMessage theMessage
end tell
end message received
end using terms from
收到邮件后没有任何反应。即使我从iChat替换消息变量(theMessage)并使用任意字符串,它仍然没有做任何事情。
我究竟做错了什么。我对applecript很新(通常是一个REALbasic编码器)。
[更新]:这似乎现在有效。一个简单的重启Mac固定的东西。很奇怪...
没有找到相关结果
已邀请:
1 个回复
坝硷操