Bellzemos Posted November 19, 2014 Share Posted November 19, 2014 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! Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted November 19, 2014 Moderators Share Posted November 19, 2014 (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 November 19, 2014 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! Link to comment Share on other sites More sharing options...
Bellzemos Posted November 20, 2014 Author Share Posted November 20, 2014 (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 November 20, 2014 by Bellzemos Link to comment Share on other sites More sharing options...
czardas Posted November 20, 2014 Share Posted November 20, 2014 (edited) Copy your code to the clipboard, click the blue box with a white A (in the editor tools area just below the smiley's) and paste your code in the popup that appears. Edited November 20, 2014 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted November 20, 2014 Share Posted November 20, 2014 (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 November 20, 2014 by SorryButImaNewbie Link to comment Share on other sites More sharing options...
Bellzemos Posted November 20, 2014 Author Share Posted November 20, 2014 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). Link to comment Share on other sites More sharing options...
JohnOne Posted November 20, 2014 Share Posted November 20, 2014 First, you should try to better explain "but it's not working properly". Look at some of the example code for the functions you use, and specifically any which use or test @error. looking at @error in general can't hurt either. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Luigi Posted November 20, 2014 Share Posted November 20, 2014 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now