Shams Posted August 13, 2015 Share Posted August 13, 2015 I wanted to allocate a number within the field in a software to a unique parameter. I used the following command:$Wet_FGD = Send ( "^C")MsgBox (0, "Wet FGD", $Wet_FGD)The first line: I selected the number and as you can see, according to the command, it copies the number. It is supposed to allocate the number to $Wet_FGD parameter. The problem is that when I ask the software to show me the Wet_FGD in MSGBOX, it always shows me 1 while my number is 1.25. To make sure that it copies the number, I pasted the command in a word file which is ok. This problem also occurs to numbers bigger and smaller than 1, such as 0.5648 and 4.133. The output from the MSGBOX is always 1 while the numbers are being correctly copied.Would you please help me with it???? Link to comment Share on other sites More sharing options...
Shams Posted August 13, 2015 Author Share Posted August 13, 2015 By the way, I do not want it to save into a text or excel file. I just want it to be saved in $Wet_FGD parameter which I can use it later. Link to comment Share on other sites More sharing options...
Jfish Posted August 13, 2015 Share Posted August 13, 2015 @Shams - I am not really sure what number you are trying to store in $Wet_FGD from the Send function. The Send function has no return value. You are just sending keystrokes. Where are you getting 1.25 when you say this:while my number is 1.25.? Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
Shams Posted August 13, 2015 Author Share Posted August 13, 2015 I am trying to save a number, which is being calculated in another software ( in this case 1.25), into $Wet_FGD variable and use this variable later on for further calculations...As you see, I selected the number (Power Requirement (% MWg) and I send Ctrl+C to copy this number. It does copy the number, but it does not put the number in the variable. If it does not have any returns, how can I allocate that number to the variable (Wet_FGD)???? Link to comment Share on other sites More sharing options...
Jfish Posted August 14, 2015 Share Posted August 14, 2015 (edited) Oh, okay, I get it now. Answer: because you are only sending the keystrokes with the Send function. The Send function does not return anything back when it is run. It is not storing the result of the "copy" operation that you are performing with those keys. If you put it to your clipboard by sending those keys you can then do this:$Wet_FGD=ClipGet ( )Alternatively, a better way would be to identify the control in the GUI with Au3Info and then try to read it directly from that control. That would be a bit cleaner. In the meantime, try this for the clipboard approach:Send ( "^C") $Wet_FGD = ClipGet() MsgBox (0, "Wet FGD", $Wet_FGD) Edited August 14, 2015 by Jfish Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
Shams Posted August 14, 2015 Author Share Posted August 14, 2015 Tnx. It worked with some modifications as I have to put sleep in some sections. Link to comment Share on other sites More sharing options...
jguinch Posted August 14, 2015 Share Posted August 14, 2015 Did you try with Autoit Windows Info, or ControlGetText ?User ControlSend instead of Send and leave the 3rd parameter blank Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF 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