你只需要編輯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