francesco.j Posted June 27, 2006 Share Posted June 27, 2006 hi! I am trying to use the skype API, but one particular give me a error. if i write this it's all ok: ;Create a Skype4COM object: $oSkype = ObjCreate("Skype4COM.Skype") $SinkObject=ObjEvent($oSkype,"Skype_") Call status events: Func Skype_CallStatus($oCall, $Status) MsgBox(0, "Call" , "Call " & $oCall.Id & " status " & $oSkype.Convert.CallStatusToText($Status)) EndFunc but i want know if skype is running, and i must use the api isRunning: [id(0x00000004), propget, helpstring("Returns Skype application running status."), helpcontext(0x00000024)] VARIANT_BOOL IsRunning(); ----------------------------------------------------------------------------------------------------- HRESULT IClient::IsRunning ( [out, retval] VARIANT_BOOL * pVal ) This command queries the running status of the Skype client. Parameters: [out] pVal receives the VARIANT_TRUE value if the Skype client is running. ----------------------------------------------------------------------------------------------------- a example in VB: If Not oSkype.Client.IsRunning Then oSkype.Client.Start() End If in skype i write: If $oSkype.Client.IsRunning Then ;Place a call to echo123: $oCall = $oSkype.PlaceCall("echo123") EndIf or ;If $oSkype.Client.IsRunning Then ; $oSkype.Client.Start() ;EndIf all two give me a error! can you help me? Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted June 27, 2006 Moderators Share Posted June 27, 2006 See what this gives you: $oSkype = ObjCreate("Skype4COM.Skype") If IsObj($oSkype) Then If $oSkype.Client.IsRunning Then MsgBox(0, "", "Skype is currently running.") Else If MsgBox(4, "", "Skype is not currently running." & @CRLF & @CRLF & _ "Would you like to start it?") = 6 Then $oSkype.Client.Start () EndIf EndIf Else MsgBox(48, "Error", "Could not create object 'Skype'.") EndIf Link to comment Share on other sites More sharing options...
francesco.j Posted June 28, 2006 Author Share Posted June 28, 2006 See what this gives you: ....i have tried this: If IsObj($oSkype) Then MsgBox(0, "", "is object") If $oSkype.Client.IsRunning Then MsgBox(0, "", "Skype is currently running.") Else If MsgBox(4, "", "Skype is not currently running." & @CRLF & @CRLF & _ "Would you like to start it?") = 6 Then $oSkype.Client.Start () EndIf EndIf Else MsgBox(48, "Error", "Could not create object 'Skype'.") EndIf but show popup "is object" after give error to signal to Microsoft: AppName: autoit3.exe AppVer: 3.1.1.126 ModName: autoit3.exe ModVer: 3.1.1.126 Offset: 00020835 note: i use beta run! maybe is a autoit bug for VARIANT_BOOL? Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 28, 2006 Share Posted June 28, 2006 (edited) See what this gives you: $oSkype = ObjCreate("Skype4COM.Skype") If IsObj($oSkype) Then If $oSkype.Client.IsRunning Then MsgBox(0, "", "Skype is currently running.") Else If MsgBox(4, "", "Skype is not currently running." & @CRLF & @CRLF & _ "Would you like to start it?") = 6 Then $oSkype.Client.Start () EndIf EndIf Else MsgBox(48, "Error", "Could not create object 'Skype'.") EndIf In your example, $oSkype.Client.Start() is only attempted after determining that $oSkype is NOT an object, so I wouldn't think that could work. Maybe insert some code to Run() the executable for Skype, wait for it to come up, and try again? Edit: Or NOT... I misread it... :"> Edited June 30, 2006 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
francesco.j Posted June 28, 2006 Author Share Posted June 28, 2006 Maybe insert some code to Run() the executable for Skype, wait for it to come up, and try again? how i can make this? Link to comment Share on other sites More sharing options...
jpm Posted June 28, 2006 Share Posted June 28, 2006 how i can make this? as I mention in the "bug report" on same subject try version .127 Link to comment Share on other sites More sharing options...
francesco.j Posted June 28, 2006 Author Share Posted June 28, 2006 as I mention in the "bug report" on same subject try version .127 I have resolvedI have tried with .127 and i have no problem!!! is a .126 bug!thanks!bye!Francesco 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