Jump to content

Recommended Posts

Posted

Hello!

So I've started with Autoit, went through the tutorial and would like to make my own scripts but I, ,of course, don't know all the commands/syntax needed. I hope you can help me.

How would I make the script check if a specific program is running and then if yes, close it, if not, do this-and-that?

I've read that AutoIt is easy but it's not SO easy. Where could I get more tutorials?

Thank you!

  • Moderators
Posted (edited)

Hi, Bellzemos, welcome to the forum. We're happy to help, just realize that we help you learn, rather than doing it for you.

To find out if an application is running, you can go a couple of ways: you can look for a specific window (WinExists), or you can look for the Process (ProcessExist). Look in the help file under either (or both) of these functions, and you'll see an example of an If statement. That should point you in the right direction.

 

Once you decide on direction, if you run into trouble, feel free to post your script here. We will do what we can to assist.

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted (edited)

Thank you!

This is what I'm trying to automate (the video link is in the first post):

'?do=embed' frameborder='0' data-embedContent>>

And this is what I wrote so far - but it's not working properly:

WinClose("C:\Program Files (x86)\Winamp\winamp.exe")
Sleep(1000)
Run("C:\Windows\System32\firefaceusb.exe")
WinWaitActive("Fireface USB Settings")
Send("{UP}")
Send("{UP}")
Send("{ENTER}")
Run("C:\Program Files (x86)\Skype\Phone\Skype.exe")
MsgBox(0, "Audio Latency", "Latancy is set to 512. Click on OK after you quit Skype.")
WinClose("C:\Program Files (x86)\Skype\Phone\Skype.exe")
Sleep(1000)
Run("C:\Windows\System32\firefaceusb.exe")
WinWaitActive("Fireface USB Settings")
Send("{DOWN}")
Send("{DOWN}")
Send("{ENTER}")
MsgBox(0, "Audio Latency", "Latancy is set back to 128.")
Edited by Bellzemos
Posted (edited)

Hello!

You can use [ autoit ] [ / autoit ] withoutspaces

in the forum, if you post your code between them it makes it look like in the program. also I suggest using wintwaitactive instead of sleep anytime thats possible

(Im a beginner too so dont take my advise that seriusly :) you will learn your own best practice in time anyway)

(edited because I actually wrote it withoutspaces at first.... )

Edited by SorryButImaNewbie
Posted

Thanx, I fixed my last message. And I am using the WinWaitActive command too. Any suggestions are welcome and much appreciated to make this work the way I would like it to (as seen in the link).

Posted
There are various languages, they each have their niche of expertise.
But among all the AutoIt has the best: the Help file.
You write a script, save, enter a command, press F1, and there is the description and the thing that facilitated learning AutoIt: an example.
This single example, simple, direct, was key so I could learn.
If there were more, I would not give much willing to learn more than this single example.
Want to learn AutoIt? But never forget the Help file! It is very important to me. My constant source of research.
 
Br, Detefon.

 

Visit my repository

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...