Jump to content

How-To Check a window if open and click on a button twice with a delay between clicks


Recommended Posts

Greetings my friends,

This is my 1st post and as you will notice i am a programming beginner.

I would like your precious help on this (maybe easy for you) task.

I have a program running.

This is Adobe Audition.

I would like to make a script which will make this...

The program works in multitrack view.

It is always in Multitrack View and the "Arm for Record" button is enabled (red).

Now, the task i would like to automate is this.

After a period of 1 hour, i want to disarm (press Arm for Record button once) and re-arm (after 1-2 seconds by pressing again same button).

This task i want to be repeated all the time, every 1-2 hours etc.Never to end.

I think i will have to use AutoIt Window Info to get the window's needed infos but then what?

I ask gently your help about this.A script like that would be a life-saver for me...

In a general way of programmer's thinking the script should be like that.

Check if Audition Window is active

If yes then

Press "Arm for Record" button once (-> It will disarm the procedure of Recording)

Delay 2 seconds

Press "Arm for Record" button once (-> It will arm again the procedure of Recording)

If no then

Maximize (Make Active) the Audition window

and

Press "Arm for Record" button once (-> It will disarm the procedure of Recording)

Delay 2 seconds

Press "Arm for Record" button once (-> It will arm again the procedure of Recording)

Then Exit.

Thanks for your time :P

Link to comment
Share on other sites

welcome to the forum feverlak!

just a snippet, not tested whatsoever:

While 1
  if Winactive("audition") = 0 Then ;use the au3info tool to check the actual name of the window
    Winactivate("audition")
  Endif

  ControlClick("audition","","[TEXT:Arm for Record]")
  sleep(2000)
  ControlClick("audition","","[TEXT:Arm for Record]")
Sleep(2*3600*1000) 
Wend

check the windows and please let me know if this is what you need

In the beginning there was nothing and then even that exploded - anonymous

Link to comment
Share on other sites

  • 3 weeks later...

While 1
  if Winactive("Adobe Audition - Untitled.ses*") = 0 Then 
    Winactivate("Adobe Audition - Untitled.ses*")
  Endif

    Send("{UP}");it is a step which makes active a selected track in multitrack environment
  sleep(2000)
  Send("!r");which actually is ALT+r ->makes what i really want (Arm for Recording) disactive
  sleep(2000)
  Send("!r");which actually is ALT+r ->makes what i really want (Arm for Recording) active again
  Sleep(10000)
Wend

First of all , DMEE thank you very much for your immediate reply ;) I really appreciate it :D

Now that we managed to make active the window we want...and send that ALT+r when we want...i need an auto repeat command.

It would be great if we could make those lines...

Send("!r");which actually is ALT+r ->makes what i really want (Arm for Recording) disactive
  sleep(2000)
  Send("!r");which actually is ALT+r ->makes what i really want (Arm for Recording) active again

to run automatically every 10 seconds (and to eternity...) for instance...so every...

Sleep(10000)
Link to comment
Share on other sites

use

Func RunMe()
While 1
  Send("!r");which actually is ALT+r ->makes what i really want
  sleep(2000)
  Send("!r");which actually is ALT+r ->makes what i really want
  Sleep(10000)
WEnd
EndFunc ;==>_RunMe()

and call the function like

; My script
RunMe()
; My Script

it will repeat every 10 seconds...

[font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php
$Life = "Happy"
If @Error Then
$Life = "Risk"
Link to comment
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
 Share

  • Recently Browsing   0 members

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