Created
March 16, 2011 00:25
-
-
Save namusyaka/871793 to your computer and use it in GitHub Desktop.
Skypeのチャットログを自動で保存していくスクリプト for Windows。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fso = new ActiveXObject("Scripting.FileSystemObject"); | |
var skype = new ActiveXObject("Skype4COM.Skype"); | |
var wss = new ActiveXObject("WScript.Shell"); | |
function Skype_MessageStatus(msg, status) { | |
var topic = "log/" + (msg.chat.Topic || "個人チャ"); | |
if(!fso.FolderExists(topic)) | |
fso.CreateFolder(topic); | |
if(status == skype.Convert.TextToChatMessageStatus("RECEIVED") || | |
status == skype.Convert.TextToChatMessageStatus("SENT")) { | |
try { | |
var date = new Date(msg.Timestamp); | |
var today = fso.OpenTextFile(topic + "/" + date.getFullYear() + date.getMonth() + date.getDate() + ".txt", 8, true, 0); | |
today.WriteLine(msg.FromDisplayName + " -> " + msg.body + " <" + date.getHours() + ":" + date.getMinutes() + ">"); | |
} catch(e) { | |
today.WriteLine(e); | |
} finally { | |
today.close(); | |
} | |
} | |
} | |
if(!fso.FolderExists("log")) | |
fso.CreateFolder("log"); | |
WScript.ConnectObject(skype, "Skype_"); | |
skype.Attach(); | |
wss.popup("ログ受信を終了する場合はOKを押してください。"); | |
skype = wss = null; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment