CuriousJ Posted June 29, 2019 Share Posted June 29, 2019 I'm having a problem with clipget. With Autoit mouse mouvement, I copy into the clipboard "+14'973" from an application. Using MSgbox, I check that the data in the clipboard is correct: "+14'973" As soon as I past using clipget into Excel or Notepad, I get "+4'973" The 10000 digit is missing. I use MSSgbox after the past and again it is correct: "+14'973" Finally, I paste directly into Excel and Notepad (without Autoit) using Ctrl+V and all is correct. Why is the number pasting incorrectly ? Just to security , I have added Sleep (1000) after each line. Any idea ? Is this related to Windows 10 localization ? Link to comment Share on other sites More sharing options...
Exit Posted June 29, 2019 Share Posted June 29, 2019 Please post your script. Then we can analyze. and .... Welcome to the forum. App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
CuriousJ Posted June 29, 2019 Author Share Posted June 29, 2019 Thanks. Here is a simple version, in this case I manually do the "copy " into the clipboard, but the problem is the same. The MsgBox is displaying correctly the number. It sound so simple but I have been on it for a long time. I'm thinking this could be a Windows localization problem. It's always causing problems with ' and , in number format. Opt("WinTitleMatchMode", 2) #include <MsgBoxConstants.au3> WinActivate ( "Untitled - Notepad" ) Sleep (1000) MsgBox($MB_SYSTEMMODAL, "", Clipget()) Sleep (1000) Send (Clipget()) Sleep (1000) MsgBox($MB_SYSTEMMODAL, "", Clipget()) Exit Link to comment Share on other sites More sharing options...
CuriousJ Posted June 29, 2019 Author Share Posted June 29, 2019 I did one more test. Instead of using the clipboard, I placed a variable Local $a = "+14'965" and then used Send $a Same problem. I get "+4'965" If use this instead, it works correctly Local $a = "14'965" I'll remove the "+" sign from the content of the clipboard and see if it works. Link to comment Share on other sites More sharing options...
CuriousJ Posted June 29, 2019 Author Share Posted June 29, 2019 It's a bit of a mess, but it works that way. With a "-" sign, it's ok. The "+" sign must be removed. Link to comment Share on other sites More sharing options...
Developers Jos Posted June 29, 2019 Developers Share Posted June 29, 2019 Add the send raw parameter to Send() or else the + has a total different meaning. Open the helpfile to figure out the details. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Subz Posted June 29, 2019 Share Posted June 29, 2019 You need to remember + equals shift when sending so use "{+}14'965" and it should work Link to comment Share on other sites More sharing options...
CuriousJ Posted June 29, 2019 Author Share Posted June 29, 2019 Ok great. I'll look it up. I search for parameters for Clipget but did not think about Send Link to comment Share on other sites More sharing options...
Bert Posted June 29, 2019 Share Posted June 29, 2019 Several suggestions First - avoid using "Send". Use ControlSend. The reason is if you send and the window focus changes, your script breaks. With ControlSend, it won't break. Second - try to see if you can hook directly into the control you want to read so you don't have to use the clipboard as a middleman. Look at ControlGetText to read the control and ControlSetText to send data to the control. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
CuriousJ Posted June 30, 2019 Author Share Posted June 30, 2019 Thanks to all. I don't need the "+". It is part of the data I am grabbing. I'll just remove it since that is what is causing my problem. I'd love to use "ControlGetText" and any other methods to avoid mouse mouvements, but the controls in the program I am using seem to change ID every time. Almost all my script is done by mouse. The only exception is I am able to use "WinGetText" for some data. P.S. I'm not a experienced programmer. 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