你只需要编辑iChat的plist文件。 defaults
是一个有点尴尬的嵌套值,因此使用系统事件,而不是:
tell application "System Events"
set EventActions to property list item "EventActions" of property list file ((path to preferences folder from user domain as text) & "com.apple.iChat.plist")
repeat with e in {property list item "MessageNotification" of EventActions, property list item "SubsequentMessage" of EventActions}
make new property list item at end of e with properties {name:"RunAppleScript", value:true}
make new property list item at end of e with properties {name:"iChatAppleScriptsKey", value:{"~/Library/Scripts/iChat/Message Received.scpt"}}
end repeat
end tell
这将附上“消息Received.scpt”双方最初的文字邀请和后续消息 - 你可以把它简化,如果你只是想将其用于后续消息。另外请注意,您可能需要重新启动iChat才能使更改生效。
我有这样的想法,只是不能让它编辑字符串 – 2011-06-18 03:11:03