Psychotron Posted May 24, 2011 Share Posted May 24, 2011 Hi, I am trying to make a script for installing a program for italian and english operating systems. I've used: WinWaitActive("Seleziona la lingua dell'installazione") It's ok on italian operating systems. With english operating systems I should use: WinWaitActive("choose setup language") Is there a way to put two possibilities? something like: WinWaitActive("Seleziona la lingua dell'installazione" or "choose setup language") Thanks in advance Link to comment Share on other sites More sharing options...
wakillon Posted May 24, 2011 Share Posted May 24, 2011 (edited) Something like this ? Do $_WinWaitActive = WinWaitActive ( "Seleziona la lingua dell'installazione", "", 1 ) $_WinWaitActive = WinWaitActive ( "choose setup language", "", 1 ) Until $_WinWaitActive <> 0 Edited May 24, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 24, 2011 Moderators Share Posted May 24, 2011 Psychotron, Welcome to the AutoIt forum. I would do something like this: #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) $hButton_E = GUICtrlCreateButton("English", 10, 10, 80, 30) $hButton_I = GUICtrlCreateButton("Italian", 100, 10, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton_E GUICreate("choose setup language") GUISetState() Case $hButton_I GUICreate("Seleziona la lingua dell'installazione") GUISetState() EndSwitch If WinExists("choose setup language") Then WinWaitActive("choose setup language") MsgBox(0, "Active", "English version") ExitLoop ElseIf WinExists("Seleziona la lingua dell'installazione") Then WinWaitActive("Seleziona la lingua dell'installazione") MsgBox(0, "Active", "Italian version") ExitLoop EndIf WEnd All clear? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Psychotron Posted May 24, 2011 Author Share Posted May 24, 2011 (edited) Wow, it's possible to make also a gui! I have to do an unattended installation, but for other purposes that's very nice! Thank you very much! I'll try your two solutions and let you know! Edited May 24, 2011 by Psychotron Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 24, 2011 Moderators Share Posted May 24, 2011 Psychotron, it's possible to make also a gui!Of course! Might I suggest reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) - this will help you enormously in your coding. You should also look at the excellent tutorials that you will find here and here - you will find other tutorials in the Wiki (the link is at the top of the page). There are even video tutorials on YouTube if you prefer watching to reading. Enjoy AutoIt. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
MHz Posted May 24, 2011 Share Posted May 24, 2011 If you want to go by the window text to know the language, then do it with the 1st window and do the rest of the install with the known language added to a variable $lang rather then trying to check for both languages through the whole script. Example Global $lang For $i = 0 To 20 If WinExists("Seleziona la lingua dell'installazione") Then $lang = 'italian' ExitLoop ElseIf WinExists('choose setup language') $lang = 'english' ExitLoop EndIf Sleep(250) Next If $lang = 'italian' Then ; progress with italian install code here ElseIf $lang = 'english' Then ; progress with english install code here Else ; lang error notification :( EndIf Link to comment Share on other sites More sharing options...
Psychotron Posted May 24, 2011 Author Share Posted May 24, 2011 Very smart. Thank you! 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