使用applescript更改iChat设置?

| 有没有一种方法可以创建一个脚本,该脚本将更改iChat的首选项以在收到消息时运行该脚本? 换句话说,我想制作一个脚本来更改iChat首选项以启用我创建的\“ Message Received.applescript \”。哇,这很令人困惑。让我简单一点。 我想要一个执行此操作的脚本: 激活iChat 打开iChat首选项 移至“警告”标签 选择事件“收到消息” 打开“运行applescript” 从名为“ Message Receive.applescript \”的脚本文件夹中选择某个脚本 请帮忙?     
已邀请:
        您只需要编辑iChat的plist文件。对于嵌套值,“ 0”有点尴尬,因此请改用系统事件:
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才能使更改生效。     

要回复问题请先登录注册