Sign in to follow this  
Followers 0
fflaque

Waiting for an event to happen

11 posts in this topic

I am stuck and was wondering if anyone could help me out. Right now I am trying to have two programs interact where the trigger would be the playing of a wav file(which is where I am having trouble). How could I have the prog listen and wait for the wav file to be played to activate the autoit to then perform the functions i already have coded?

Share this post


Link to post
Share on other sites



I am stuck and was wondering if anyone could help me out.  Right now I am trying to have two programs interact where the trigger would be the playing of a wav file(which is where I am having trouble).  How could I have the prog listen and wait for the wav file to be played to activate the autoit to then perform the functions i already have coded?

<{POST_SNAPBACK}>

You might use WinWaitActive()

The script is going to go on only when he'll see a window poped up with a specified name

Share this post


Link to post
Share on other sites

You might use WinWaitActive()

The script is going to go on only when he'll see a window poped up with a specified name

<{POST_SNAPBACK}>

k thanks, i'll try that and see if it works :ph34r:

Share this post


Link to post
Share on other sites

k thanks, i'll try that and see if it works :ph34r:

<{POST_SNAPBACK}>

little problem, i just realized that when the wav file is played it is not opened separately in windows media but through the program i am using, is there a way to check if a file(like a wav file) is being accessed by a program.

Share this post


Link to post
Share on other sites

Why don't u just use the Sleep () command? Just set it to sleep for like 10 seconds if your thing is really slow or whatever.

Share this post


Link to post
Share on other sites

Why don't u just use the Sleep () command? Just set it to sleep for like 10 seconds if your thing is really slow or whatever.

<{POST_SNAPBACK}>

sleep? the problem i am having is identifying if a wav file is being accessed or not.

Share this post


Link to post
Share on other sites

Oh, sorry, please ignore me.

Share this post


Link to post
Share on other sites

Oh, sorry, please ignore me.

<{POST_SNAPBACK}>

its ok

Share this post


Link to post
Share on other sites

try looping fileopen() on the file. if fileopen fails, perhaps you can assume the file is open, and playing...

While FileOpen("file.mp3") <> -1

  Sleep(5000)

Wend

if the mp3 is shorter than 5 seconds this may fail... this is only a theory... no idea if it is applicable.

LAr.

<{POST_SNAPBACK}>

Thanks Larry I'll try that and see if it works, hopefully it will.

Share this post


Link to post
Share on other sites

tested... doesn't work

Lar.

<{POST_SNAPBACK}>

darn....thanks anyways

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0