PinetSebastien Posted September 19, 2014 Share Posted September 19, 2014 Hi, I currently have a working Script that opens an email templates, insert strings on certain lines, and remove other lines. It looks like the image below. But the way I do it is that I send Keys to the CTRLid, so something like DOWN 6 times, BS 9 times, type this or that string. It works fine but there is one problem. If the window of the email template is smaller ( like you can see on the 2nd image ), there is more line, so my script does not work anymore. So my question is, how can I change certain lines on the email template in a way that it will work whoever or big or small the window is? ffffd Link to comment Share on other sites More sharing options...
MikahS Posted September 19, 2014 Share Posted September 19, 2014 Post your script so we can have a look Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
PinetSebastien Posted September 19, 2014 Author Share Posted September 19, 2014 ControlFocus ( " Secret window name ", " Text ID " , "[CLASS:_WwG; INSTANCE:1]" ) ControlSend( " Secret window name ", " Text ID " , "[CLASS:_WwG; INSTANCE:1]" , "{Down 6}{END}{SHIFTDOWN}{LEFT 8}{SHIFTUP}" ) ControlSend( " Secret window name ", " Text ID " , "[CLASS:_WwG; INSTANCE:1]" , $password ) It can`t really do it because it contains confidential information. But it goes like that. Again it only works if the window is maximized. Or else there is more line, So my "down 6times* does not go the same line as another employe who has a smaller screen resolution. Link to comment Share on other sites More sharing options...
MikahS Posted September 19, 2014 Share Posted September 19, 2014 (edited) Why not just: ControlGetPos() ; use this to get the current pos of the window GUICtrlSetPos() ; use this to set the window to a pos before the ControlFocus and Sends. EDIT: Then when your script completes you can use the ControlGetPos to set the window back to how it was before you sent. Edited September 19, 2014 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
PinetSebastien Posted September 19, 2014 Author Share Posted September 19, 2014 Sounds like a great idea. I'll try that. I'll let you know. Thank you very much MikahS 1 Link to comment Share on other sites More sharing options...
Solution MikahS Posted September 20, 2014 Solution Share Posted September 20, 2014 Anytime PinetSebastien 1 Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ 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