Skype4COM: Chats.vbs

Skype4COM

Chats.vbs

This script queries chats in chat history.

Copyright � 2004-2006 Skype Limited. Licensed under BSD license.

'// Create a Skype4COM object:
Set oSkype = WScript.CreateObject("Skype4COM.Skype","Skype_")

'// Start the Skype client:
If Not oSkype.Client.IsRunning Then oSkype.Client.Start() End If

'// Query the total number of messages in history:
WScript.Echo "Total message count: " & oSkype.Messages.Count

'// Query the timestamp, name, and display name of all chats in history:
WScript.Echo  "All chats:"
For Each oChat In oSkype.Chats
  WScript.Echo  oChat.Timestamp & " " & oChat.Name & " " & oChat.FriendlyName
Next  

'// Query the timestamp, name, and display name of all active chats:
WScript.Echo  "Active chats:"
For Each oChat In oSkype.ActiveChats
  WScript.Echo oChat.Timestamp & " " & oChat.Name & " " & oChat.FriendlyName
Next  

'// Query the timestamp, name, and display name of all missed chats:
WScript.Echo  "Missed chats:"
For Each oChat In oSkype.MissedChats
  WScript.Echo  oChat.Timestamp & " " & oChat.Name & " " & oChat.FriendlyName
Next  

'// Query the timestamp, name, and display name of all recent chats:
WScript.Echo  "Recent chats:"
For Each oChat In oSkype.RecentChats
  WScript.Echo oChat.Timestamp & " " & oChat.Name & " " & oChat.FriendlyName
Next

'// Query the timestamp, name, and display name of all bookmarked chats:
WScript.Echo "Bookmarked chats:"
For Each oChat In oSkype.BookmarkedChats
  WScript.Echo oChat.Timestamp & " " & oChat.Name & " " & oChat.FriendlyName
Next

'// The AttachmentStatus event handler monitors attachment status and automatically attempts to reattach to the API following loss of connection:
Public Sub Skype_AttachmentStatus(ByVal aStatus)
  WScript.Echo ">Attachment status " & oSkype.Convert.AttachmentStatusToText(aStatus)
  If aStatus = oSkype.Convert.TextToAttachmentStatus("AVAILABLE") Then oSkype.Attach() End If
End Sub

Copyright � 2006 Skype Limited. All rights reserved.