nutahcoder Posted 6 hours ago Posted 6 hours ago Hello AutoIt Experts, I'm new to AutoIt, I hope someone could give some advice and guidance. I created my first script with the following workflow: launches a Program writes on the window - actually a command closes the Program It behaves as I expect it to be on my computer (compiled or as script) However, on another computer, the compiled script behaves differently. When it writes the command, it does not highlight the pre-existing texts firsts and therefore appends the command to the pre-existing texts Whereas on my computer, it would highlight the pre-existing text first therefore it overwrites the pre-existing texts with the command. Below is the code where it behaves differently. ControlFocus("myProgram","","[NAME:MyProgramCmdLineTextBox]") ControlSend("myProgram", "", "[NAME:MyProgramCmdLineTextBox]", "MyCommand(parameter) {ENTER}") My computer is a 64-bit Windows 10 The other computer is a 64-bit Windows 7 What am I doing wrong? Any advice or general rule on how I can make a script work regardless of which computer I run it to? Please advise.
Solution rudi Posted 4 hours ago Solution Posted 4 hours ago Hello, welcome to the forum! I guess, that not autoit is behaving differntly, but the program, that you want to drive: Just launch it manually on both machines and compare, if on the one the content of the target is "marked" (highlighted), but not on the other one? Try controlsettext() instead of controlsend() Earth is flat, pigs can fly, and Nuclear Power is SAFE!
nutahcoder Posted 3 hours ago Author Posted 3 hours ago Hello rudi, Thank you for the welcome and thanks for pointing out the difference in the program. I realize that the program I'm opening is a different version on my computer. I'll try out your suggestion.
nutahcoder Posted 26 minutes ago Author Posted 26 minutes ago Just an update, ControlSetText() worked on both computers. Thanks again! argumentum 1
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