Jump to content

Skype4Com


anixon
 Share

Recommended Posts

I am posting this information for those who have an interest in the Skype4Com Public API and AutoIT Connecitivty

In some code example in the Skype4Com documention this is is how the Attach command is documented which for readers has been converted from VB to AutoIT. $oSkype.Attach() ;//System Sets the Default Protocol Value () to 5 $oSkype.Attach(5) ;//Default Protocol Value (5) Enforced It has been recommended by a Skype4Com C++ and VB developer that this call should always use 'Protocol' 8 [undocumented in the Skype4Com Manual] but apparently its to overcome compatibility issues in previous Skype4Com versions [information not validated by me] . If adopted [and yet to be fully tested by me] this command would be changed to this: $oSkype.Attach(8) AND

In Skype Version 5.1.0.104 the $oSkype.Client.IsRunning command does not work as it returns 'false' irrespective of whether Skype is running or not. This is a known bug in Skype 5 but I am not sure if or when it will be fixed by Skype. If not replaced with the AutoIT script equivalent then when called it simply sets the focus on the Skype window. If Not $oSkype.Client.IsRunning Then

The AutoIT workaround is If Not ProcessExists(skype.exe) Then

AND

The SMS Identity be it either the User ID or Validated Mobile Number is no longer supported in Skype 5 and if the Skype Version 4 of the AutoIT Code is used to send an SMS when Skype 5 is the installed version the SMS will fail when 'Composing' with Skype returning the value 2 .

This is the coded example of my Skype Version 4 and 5 workaround.

Func _SendSMS($PhoneNum, $Message, $sSMSIdentity)
;//Read the Skype Version
  $SkypeVer = StringLeft(FileGetVersion(@ProgramFilesDir & "\Skype\Phone\skype.exe"), 1)
  ;//Skype Version 4 SMS Send Process
  If $SkypeVer = 4 Then
   ;//Compile the SMS Identity [Skype 4 only] if the third attribute is Null or not present the SMS Identity is automatically set to the User ID by Skype.
   Local $sSMSID = $oSkype.CurrentUserprofile.ValidatedSmsNumbers()
   If $sSMSIdentity <> $sSMSID Then $sSMSIdentity = ""
   ;//Send the SMS Message
   $oSms = $oSkype.SendSms($PhoneNum, $Message, $sSMSIdentity)
  EndIf
  ;//Skype Version 5 SMS Send Process
  If $SkypeVer = 5 Then
   Local $ismsmessage = $oSkype.CreateSms($smsMessageTypeOutgoing, $PhoneNum)
   $ismsmessage.Body = $Message
   $ismsmessage.Send()
  EndIf
  ;//Wait for Skype API
  Sleep($SmsSLD)
EndFunc

I would especially like to thank jaberwocky6669 for his assistance with the code required to send an SMS in sSkype Version 5 Ant.. :)

Edited by anixon
Link to comment
Share on other sites

  • 10 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...