Jump to content

Recommended Posts

Posted

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:

  1. launches a Program
  2. writes on the window - actually a command
  3. 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
Posted

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!

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...