Jump to content
stonheng

Help with Simple Script for Newbie

Recommended Posts

stonheng

Hello,

I have limited programming experience and am looking to automate a fairly simple task as follows:

1) make an application active (I don't need it to automatically open the application)

2) Enter a key stroke (such as Control-F2) to start a process

3) Pause for a short period of time (say 3 seconds)

4) Then hit the Enter key; pause again (3 seconds)

5) Repeat step 4 several more times (but the length of pause may vary in a few spots)

I would appreciate any help to do this. And if possible it would be great to get the full step by step instructions because I am starting from zero knowledge of AutoIt. 

 

 

Share this post


Link to post
Share on other sites
Earthshine
Posted (edited)

you should really read and understand the help file because everything you've mentioned is in there. it's supposed to be 'teach a person to fish' method here. we are here to assist you with your script which may be based on help file examples. 

Or you may get lucky and someone will do it for you

 for your requirement number one look at WinWaitActive function for starting 

Edited by Earthshine
  • Like 1

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
stonheng

I understand and appreciate your response.  As an active member in other forums, I do understand the frustration of people posting questions such as mine. I would definitely be up for learning to fish if I anticipated having additional needs for this type of automation. But in my situation that is really not the case. So its a bit hard to justify learning the whole programming language just to do this one thing. So was hoping someone could walk me through how to do it if its not too much trouble. 

Share this post


Link to post
Share on other sites
JLogan3o13

And he did just that. Look at WinWaitActive in the help file, it has examples to show you how it works. You have to put forth at least a modicum of effort; we don't support the whole "do it for me because I don't want it now" mentality. 

To that point, what is the application you're trying to automate. There may well be a better way.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
stonheng

The application is not a very well known app. It's called HCFR and is used for video calibration. 

Here is what I have been able to piece together so far. On the right track? 

WinWaitActive("HCFR.exe") 
Send("{F2}") 

Send("{Enter}")

Sleep, 7000
Send("{Enter}")

Sleep, 7000
Send("{Enter}")

Sleep, 3000
Send("{Enter}")

Sleep, 3000
Etc

 

Share this post


Link to post
Share on other sites
stonheng

Thanks! It worked. The only change I had to make is to use WinActivate vs. Activate that wasn't recognized as a function.

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

×