anixon Posted January 23, 2011 Share Posted January 23, 2011 This code will send a Skype SMS's provided that you are running Skype Version 4.2.0.187 expandcollapse popup;// Create a Skype4COM object: $oSkype = ObjCreate("Skype4COM.Skype") $oSkypeEvent = ObjEvent($oSkype, "Skype_") $oError = ObjEvent("AutoIt.Error", "MyErrFunc") ;// Start the Skype client: If Not $oSkype.Client.IsRunning Then $oSkype.Client.Start() EndIf ;// Verify that a user is signed in and online before continuing While 1 If $oSkype.CurrentUserStatus = $oSkype.Convert.TextToUserStatus("ONLINE") Then ExitLoop Else $oSkype.ChangeUserStatus($oSkype.Convert.TextToUserStatus("ONLINE")) EndIf Sleep(1000) WEnd ;// The AttachmentStatus event handler monitors attachment status and returns the Skypename of the user when the status is "success": Func Skype_AttachmentStatus($aStatus) MsgBox(0, "", "Attachment status " & $oSkype.Convert.AttachmentStatusToText($aStatus)) If $aStatus = $oSkype.Convert.TextToAttachmentStatus("AVAILABLE") Then $oSkype.Attach() EndIf If $aStatus = $oSkype.Convert.TextToAttachmentStatus("SUCCESS") Then MsgBox(0, "", "Current user is " & $oSkype.CurrentUserHandle) EndIf EndFunc ;==>Skype_AttachmentStatus Func _SendSMS() Local $MyMobileNumber = "+61401523364"; Local $MyMessageText = "This is a test SMS"; $oSms = $oSkype.SendSms($MyMobileNumber, $MyMessageText, "") EndFunc ;==>_SendSMS ;==>_SendSMS Func MyErrFunc() ;Do Nothing EndFunc ;==>MyErrFunc Sleep(5000) _Sendsms() Exit In Skype Version 5.n the reply to number which is attribute 3 in $oSkype.SendSMS is no longer supported and fails when its being composed by Skype even if this attribute is set to null or omitted as per this example: $oSms = $oSkype.SendSms($MyMobileNumber, $MyMessageText) As a matter of interest both examples work in Skype Version 4.2.0.187 I have been informed that the work around for Skype version 5.nn is not to use $oSkype.SendSms to send an SMS rather the following code which is written in'C' { ; / / Change this telephone number To a vaild one String MySmsNumber = "+16515551212"; String MySMStext = "This is a test message"; ISmsMessage ismsmessage = skype.CreateSms(TSmsMessageType.smsMessageTypeOutgoing, MySmsNumber); ismsmessage.Body = MySMStext; ismsmessage.Send(); Unfortunately I have no experience with 'C' and was hoping that an AutoIT subscriber could help me by converting the code so that it will run when calling Func _SendSMS() Replies are always appreciated Ant.. Link to comment Share on other sites More sharing options...
jaberwacky Posted January 23, 2011 Share Posted January 23, 2011 Really it's c++ and you'll need to find out more about TSmsMessageType to proceed, I think. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
anixon Posted January 23, 2011 Author Share Posted January 23, 2011 Really it's c++ and you'll need to find out more about TSmsMessageType to proceed, I think.According to the Skype4Com Documentationenum TSmsMessageType { smsMessageTypeUnknown = -1, smsMessageTypeIncoming = 0, smsMessageTypeOutgoing = 1, smsMessageTypeCCRequest = 2, smsMessageTypeCCSubmit = 3 }I hope that is helpfulAnt.. Link to comment Share on other sites More sharing options...
jaberwacky Posted January 23, 2011 Share Posted January 23, 2011 (edited) No guarantees because I'm hacking away blindly but give this a shot. Enum $smsMessageTypeUnknown = -1, $smsMessageTypeIncoming, $smsMessageTypeOutgoing, $smsMessageTypeCCRequest, $smsMessageTypeCCSubmit Func _SendSMS() Local $MyMobileNumber = "+61401523364" ; Change this telephone number To a vaild one Local $MyMessageText = "This is a test SMS" Local $ismsmessage = $oSkype.CreateSms($smsMessageTypeOutgoing, $MyMobileNumber) $ismsmessage.Body = $MyMessageText $ismsmessage.Send() EndFunc ;==>_SendSMS Edited January 23, 2011 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
anixon Posted January 23, 2011 Author Share Posted January 23, 2011 (edited) Absolutely brilliant worked exactly as required in Skype version 4.2.0.187 now for the moment of truth does it work in Skype version 5.nn give me 10 mins and I will let you knowAnt..Edit: I just downloaded Skype Version 5.1.0.104 and your code converted from c++ works perfectly in both version 4.2.0.187 and 5.1.0.104. I have been working on trying to find a solution to this issue Skype 5.nn issue since November last and to tell you the truth it has been a bit frustrating. The fact that you have been able to help with converting the c++ to AutoIT is not only terrific help to me but my guess to all other AutoIT subscribers that have been working with the Skype API 'Skype4Com' Thank you again - YHS Ant. . Edited January 23, 2011 by anixon Link to comment Share on other sites More sharing options...
jaberwacky Posted January 23, 2011 Share Posted January 23, 2011 Hey, no problem. I am pleased that it works. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now