Kemal Posted January 16, 2005 Share Posted January 16, 2005 Hi, I've been working on an AutoIT script for Directory Opus v8.0, after some gentle pointing to AutoIt by Astalavista and MAVERICKS CHOICE in response to a thread about CloneDVD2. Thanks again for that script btw MAVERICKS CHOICE, works beautifully.Anyhow I decided to give writing scripts a a go myself. This program has been bugging me for a while, no silent switches I can identify, and it was a very hit and miss thing with repackaging, sometimes it seemed to work and sometimes it didn't, as it integrates into the windows explorer as a replacement it was very hard to tell which registry changes were important and which were not, sometimes it fell over in a horrendous mess. My script seems to work ok, but I was hoping some experienced scripters might have a once over and tell me if I did anything stupid or there's a better way to do something. Opt("WinWaitDelay", 400)Run ("Directory.Opus.8.0.0.0.Silent.Update.Installer.exe")Opt("MouseCoordMode",0)WinActivate("Directory Opus 8 Setup","")WinWaitActive("Directory Opus 8 Setup","")Send("n")Sleep (100)Send("{ALTDOWN}y{ALTUP}")Sleep (100)Send("{ALTDOWN}n{ALTUP}")Sleep (100)Send("{ALTDOWN}n{ALTUP}")WinActivate("Directory Opus 8 Setup","")WinWaitActive("Directory Opus 8 Setup","Yes, I want to launch Directory Opus now.")Send("{SPACE}{ENTER}")The biggest problem I had was with the last part as the actual install time seemed to vary immensely, and all of the install windows used the same Title. Have I used the WinWaitActive command correctly? WinWaitActive("Directory Opus 8 Setup","Yes, I want to launch Directory Opus now.")The "Yes, I want to launch Directory Opus now." being text on the final screen.Should I have a sleep command in between the 2nd last set of keys and the final WinActivate. It seems to take anywhere from 3 seconds to 15 seconds to install between those last two steps. If I use text form each screen with WinWaitActive does that mean I can actually eliminate all sleep commands?I also tried the MouseClick method but that seems somewhat unprofessional to me. With the mouse zipping all about the screen and all. I like the send method much more.Thanks in advance for any feedback. Link to comment Share on other sites More sharing options...
Nologic Posted January 17, 2005 Share Posted January 17, 2005 WinWaitActive does remove the need for error prone sleep commands. ControlClick beats the snot out of Send.MouseClick is okay when there is no other option but to Send....and when using it make sure to set its speed to 1 so that its movement is near instant rather than getting stuck there watching it dance across the screen. Make use of User Vars or better yet use a INI file, to allow the end user some ablity to tweak the setup.Look for some crazy new stuff from me shortly. Any ways your getting your hands dirty and making some scripts so good show for that bit, and thanks for sharing your efforts with others. Link to comment Share on other sites More sharing options...
Kemal Posted January 17, 2005 Author Share Posted January 17, 2005 Thanks for the tips Nologic. I did the script once with Mouseclick but the slow mouse speed was what got me... I am very new to this. But I just learned how to fix that from you. Thanks. I'll go teach msyelf about ControlClick now, and do it over again, for the practice 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