以下 AppleScript 只会在收到的第二条和后续消息触发,但不会触发第一条未启动的消息。我抓住了 SpeakEvents.applescript 并戳了几个,只是为了进行故障排除。现在我只是想回应收到的任何内容。
using terms from application "Messages"
on message received theMessage from theBuddy with messageBody
send messageBody to theBuddy
say messageBody
end message received
on chat room message received with messageBody
say messageBody
end chat room message received
on active chat message received with messageBody
say messageBody
end active chat message received
on addressed message received theMessage from theBuddy for theChat with messageBody
say messageBody
end addressed message received
on received text invitation with messageBody
say messageBody
end received text invitation
on received audio invitation theText from theBuddy for theChat with messageBody
say messageBody
end received audio invitation
on received video invitation theText from theBuddy for theChat with messageBody
say messageBody
end received video invitation
on buddy authorization requested with messageBody
say messageBody
end buddy authorization requested
on addressed chat room message received with messageBody
say messageBody
end addressed chat room message received
# The following are unused but need to be defined to avoid an error
on login finished with messageBody
say messageBody
end login finished
on logout finished with messageBody
say messageBody
end logout finished
on buddy became available with messageBody
say messageBody
end buddy became available
on buddy became unavailable with messageBody
say messageBody
end buddy became unavailable
on received file transfer invitation theFileTransfer with messageBody
say messageBody
end received file transfer invitation
on av chat started with messageBody
say messageBody
end av chat started
on av chat ended with messageBody
say messageBody
end av chat ended
on completed file transfer with messageBody
say messageBody
end completed file transfer
end using terms from