Jump to content

Recommended Posts

Posted (edited)

Hello!

I'm trying use Skype API via Skype4COM.dll and so far everything works fine, except for one thing: whenever I start skype via the skype4com object I have to put the script in sleep for a few seconds until skype fully started, because if I don't do that, script dies with the error message Posted Image

Why in the world AU3 would kill the script instead of put error code into @Error or something is beyond my very limited understanding...

Here is the code:

$oSkype = ObjCreate("Skype4COM.Skype")
$oSkype.Client.Start()

; Wait untill skype is started
While NOT $oSkype.Client.IsRunning
    Sleep(1)
Wend

;Sleep(5000)
; Connect to the Skype API:
$oSkype.Attach

Exit

As you can see, the script will "pause" until skype is started, that part is working, but apparently there is a few seconds gap before skype is able accept plugin attachments after its started...and that gap will probably vary depend on system speed...

So, anyway avoid this problem without placing the script into sleep? (sleep is only a work around and not 100% error proof in this case)

Thank you.

Edited by vanowm
Posted (edited)

That's it! Thank you very much :)

Problem solved :)

P.S. here is a working example on how it could be done:

Edited by vanowm

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
  • Recently Browsing   0 members

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