有没有办法创建一个脚本来更改iChat的首选项,以便在收到消息时运行该脚本?
换句话说,我想创建一个脚本来更改消息首选项,以启用我创建的“iChat Received.applescript”。哇,这太让人困惑了。让我简单地说一下。
我想要一个这样的脚本:
激活iChat打开iChat首选项移动到“警报”选项卡选择事件“收到的消息”打开“运行应用程序脚本”从名为"Message Receive.applescript“的脚本文件夹中选择某个脚本
请帮帮忙?
发布于 2011-06-17 15:54:10
你只需要编辑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
这会将"Message Received.scpt“附加到初始文本邀请和后续消息-如果您只想在后续消息中使用它,您可以简化它。另请注意,您可能需要重新启动iChat才能使更改生效。
https://stackoverflow.com/questions/6301688
复制相似问题