Dewey6 Posted October 24, 2010 Share Posted October 24, 2010 Hi everyone, Big beginner here. Very big. PArdon the simplicity of my question. How do you paste a window-text (as in WinWaitActive("Notepad", "window text") if the window text is printed on several lines? For instance, if I get a window text saying: "Do you want to save your file Or go bake french fries instead" Autoit v3 Window info tool will report the following text: "Do you want to save your file (strange sign resembling a mignaturized Dolby logo)Or go bake french fries instead" The copy-pasteing of the latter gives the following result: WinWaitActive("Notepad", "Do you want to save your file Or go bake french fries instead" wich is not usable in the script, of course. So what shall I do with my strange sign? I guess it's simply a sign that gives the order to change line, but how do I paste it? I try to just ommit the sign, but it gives nothing better. Thanks for your answers. Dewey Link to comment Share on other sites More sharing options...
jlarson Posted October 24, 2010 Share Posted October 24, 2010 Would this work? WinWaitActive("Notepad") Send("Do you want to save your file {ENTER} Or go back french fries instead.") Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 24, 2010 Moderators Share Posted October 24, 2010 Dewey6,Welcome to the AutoIt forum. Your "minaturized Dolby logo" is a carriage return and line feed - which in AutoIt is replaced by the @CRLF macro. In order to combine the 2 lines of text you need to use the concatenation operator & like this:$sText = "Do you want to save your file" & @CRLF & "Or go bake french fries instead" WinWaitActive("Notepad", $sText")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...
Dewey6 Posted October 24, 2010 Author Share Posted October 24, 2010 att Jlarson: thx, but it doesn't seem to do the trick att Melba23: What you explianed is very clear. But it's not working. I know theat the window text must be very carefully pasted, but it doesnot work. ANyway, I think I will read more of the "learning to script with autoIt" pdf. There are too many questions that remain unanswered for me to begin and ask here each time something is unexplained. Want an example? What is a scope? I know the word, I think I know what it means even thought I'm french, but Dim/Global/and Local still means nothing to me. I guess it will come. I might look for a French written tutorial too ) Thanks for your answer, anyway, and for the welcome. Link to comment Share on other sites More sharing options...
Varian Posted October 25, 2010 Share Posted October 25, 2010 I think the function WinGetText will help you. If you want to read the text from a window$wText = WinGetText("Notepad")The variable $wText will then contain all of the text that AutoIT can read from the window If you are trying to identify a window with WinWait or WinExists, you do not have to pass all of the text (with line breaks) to the function...you only need to pass enough text to differentiate the window. Par example, if there is only one Notepad window open, you do not have to specify any text at all to identify itWinWait("Notepad", "") ;or Winatwait("[CLASS:Notepad]", "")If there are multiple Notepad windows open, you just need to pass enough text to specify the on that you wantWinWait("Notepad", "unique text for the window")Hope this helps Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 25, 2010 Moderators Share Posted October 25, 2010 Dewey6What is a scope? I know the word, I think I know what it means even thought I'm french, but Dim/Global/and Local still means nothing to me.Look at the Variables - using Global, Local and ByRef tutorial in the Wiki and everything should become much clearer. 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...
Dewey6 Posted October 26, 2010 Author Share Posted October 26, 2010 Dewey6Look at the Variables - using Global, Local and ByRef tutorial in the Wiki and everything should become much clearer. M23Thanks for both your answers. Varian's answer is interesting because it made me discover how many way there was to identify a window.And btw: you are right: I should stick to identifying the window by a portion of the beginning of it's name, like mode 1 allows. In time, I will find a use for the more elaborate or complete identification.Melba23's answer made me realize that I had tooooooo many documentation to read.Furthermore, I found a french translation of the help file )Now that's study time. Huey 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