JTB Posted July 18, 2006 Share Posted July 18, 2006 I'm just starting to write my own scripts using AutoIt and I'm starting with creating scripts to install my applications. I'm using the install WinZip tutorial as my model. I've tried this approach with installing a couple different applications but the scripts seem to always get stuck because the second WinWaitActive never seems to get satisfied. My script: Run("\\MyServer\apps\BeyondCompare 2.4.1\beycomp_060323.exe") WinWaitActive( "Open File - Security Warning", "Scooter Software") Send( "R") WinWaitActive( "Setup", "", 3 ) Send( "Y") The first WinWaitActive seems to work as I'd expect, but the second one just causes the script to pause forever, even when I added the 3 second timeout (which I'd expect to just pause for 3 seconds waiting for the window "Setup" to become active. If it doesn't become active, the script continues anyway). What am I doing wrong? Link to comment Share on other sites More sharing options...
jvanegmond Posted July 18, 2006 Share Posted July 18, 2006 (edited) Opt("WinTitleMatchMode", 2) now use the PARTIAL TITLE. :banana: If it doesn't fix the problem, then use WinExists in stead of WinWaitActive() Edited July 18, 2006 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
JTB Posted July 18, 2006 Author Share Posted July 18, 2006 Opt("WinTitleMatchMode", 2)now use the PARTIAL TITLE. :banana:If it doesn't fix the problem, then use WinExists in stead of WinWaitActive()Nope, neither one worked.Here's the info from the AutoIt Window Info application when the Setup window is active:Press CTRL-ALT-F to pause the display.>>>>>>>>>>>> Window Details <<<<<<<<<<<<<Title: SetupClass: #32770Size: X: 301 Y: 259 W: 353 H: 126>>>>>>>>>>> Mouse Details <<<<<<<<<<<Screen: X: 873 Y: 294Cursor ID: 5>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<RGB: Hex: 0xECE9D8 Dec: 15526360>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<Size:Control ID:ClassNameNN:Text:>>>>>>>>>>> Status Bar Text <<<<<<<<<<<>>>>>>>>>>> Visible Window Text <<<<<<<<<<<&Yes&NoThis will install Beyond Compare. Do you wish to continue?>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<Now what? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 18, 2006 Moderators Share Posted July 18, 2006 (edited) Try this:Opt('WinSearchChildren', 1) Run("\\MyServer\apps\BeyondCompare 2.4.1\beycomp_060323.exe") WinWaitActive( "Open File - Security Warning", "Scooter Software") Send("R") WinWaitActive("Setup", "", 3) Send("Y")oÝ÷ Øí«]¡ë'ßÛp¢¹-¯+aÆ®¶sd÷Bb33µvå6V&66ÆG&Vâb33²Â ¥'VâgV÷C²b3#²b3#´×6W'fW"b3#¶2b3#´&WöæD6ö×&R"ãBãb3#¶&W6ö×óc3#2æWRgV÷C²¥våvD7FfRgV÷C´÷VâfÆRÒ6V7W&Gv&æærgV÷C²ÂgV÷Cµ66ö÷FW"6ögGv&RgV÷C²¥6VæBgV÷Cµ"gV÷C²¢b33c´÷EuDÔÒÒ÷Bb33µvåFFÆTÖF6ÖöFRb33²ÂB¥våvD7FfRgV÷C¶6Æ76æÖSÓ3#ssgV÷C²¤÷Bb33µvåFFÆTÖF6ÖöFRb33²Âb33c´÷EuDÔÒ¥6VæBgV÷CµgV÷C² Edit: Had to fix a typo, and wow, the text is encrypted when you use AutoIt Code Tags when you try to edit!! Edited July 18, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
MHz Posted July 18, 2006 Share Posted July 18, 2006 (edited) >>>>>>>>>>> Visible Window Text <<<<<<<<<<< &Yes &No This will install Beyond Compare. Do you wish to continue? >>>>>>>>>>> Hidden Window Text <<<<<<<<<<< Now what?The >Visible Window Text< shows the accellerator key ALT is to be used on the buttons. So pressing the Alt + n keys or Alt + y keys together will choose the option. Send("!n") ; click no button ; or use Send("!y") ; click yes button Edit: Also good to know is hovering the mouse over the button will allow AutoIt Info Tool will show the info in the Control under Mouse section. That would give you the info of the controls details needed if possible. Edited July 18, 2006 by MHz Link to comment Share on other sites More sharing options...
JTB Posted July 18, 2006 Author Share Posted July 18, 2006 The >Visible Window Text< shows the accellerator key ALT is to be used on the buttons. So pressing the Alt + n keys or Alt + y keys together will choose the option. Send("!n") ; click no button ; or use Send("!y") ; click yes button oÝ÷ ØGb´ l¢ (vÚ$"²/z¸§Ø^¬zÞ®Ø^nëm¢|"V¥ºÚ´ß¡:(¥ÈhÂØ^wè{ax*'¶º%ºw^¬Ê.±ërب8Z· .Ø"½ì¨ºØ^wè¡ûayÊ'¶º%±×j)lçyئ,¹^þ«¨µãN§Çè©e¶¬º²Ø¨Ì!ÈH¶¸u»ÞÂäyÑèÁëÞ¬buø º·¨ºÛazènW¦N¬r¸©·¬iËnjYr¥«¬yÚ'¶»-Z)Öj+@rدy©ÝmërÝjëh×6Run("\\MyServer\apps\BeyondCompare 2.4.1\beycomp_060323.exe") WinWaitActive( "Open File - Security Warning", "Scooter Software") Send( "R") WinWaitActive( "Setup", "", 3 ) Send( "Y") The Open File - Security Warning Dialog opened when I ran the installer file manually but not when I issued the Run command from within AutoIt. This leads me to my new question: I could tell the AutoIt script was paused and waiting for something (because of the icon in the system tray), but is there a way to tell which line it on? (This info would have saved a lot of time troubleshooting the wrong line of code) Link to comment Share on other sites More sharing options...
BPBNA Posted July 18, 2006 Share Posted July 18, 2006 Opt("TrayIconDebug", 1) As for the security warning try Run("\\MyServer\apps\BeyondCompare 2.4.1\beycomp_060323.exe") If WinExists( "Open File - Security Warning", "Scooter Software") then Send( "R") WinWaitActive( "Setup", "", 3 ) Send( "Y") 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