Jump to content

help with losing keystrokes sent


Recommended Posts

Hi All,

I am currently using AutoIt on a remote PC over remote desktop. I have turned off the clipboard feature on Remote Desktop (since I am copying and pasting text on the remote PC) and have discovered that minimizing the Remote Desktop session and screen savers kicking on will mess up the AutoIt execution. These have been avoided during testing. I am also using the latest version of AutoIt.

I am trying to find out any tips or tricks you all have used to make AutoIt be a little more consistent. One area I keep seeing being in consistent is with both ControlClick and ControlFocus. These were used to click OK, CANCEL, QUERY, or some other button on a window. I have found that calling ControlFocus on the button and sending {SPACE} to be the more consistent of the two. I still see that the ControlFocus call will set focus to the button, but the {SPACE} call gets lost (the button doesn't actually get clicked).

Also, when sending ALT commands to open the file menu on a window seems to not work sometimes as well. I have added sleep timers to wait after the window is active, but that didn't seem to help. I seems like the sendkeys just gets lost.

I can post some specific code if needed.

Thanks,

Link to comment
Share on other sites

I can't help with the ControlClick or ControlFocus parts because I don't use those, but on the ALT commands you can easily navigate the file menus using send. Most windows will have underlined letters for at least the base menus and probably some of the subitem selections. You can chain these together with a single alt press.

For example in firefox...

Send("!vtb")

... will enter the View menu, select the Toolbars submenu, and select the Bookmark Toolbars item.

You can also use something like...

Send("!t{UP}{ENTER}")

... to go to options (yes, I know there is a shortcut already, this is just an example)

It will use the "t" to enter Tools menu, "{up}" to wrap around to the last option and "{enter}" to select it.

Link to comment
Share on other sites

Just want to clear things out. Are you executing an AutoIt script located on the remote PC while you are in Remote Desktop? Or are you executing an AutoIt script on your local machine which interacts with the Remote Desktop session?

I sometimes run AutoIt scripts on remote PCs via Remote Desktop. I'm not exactly sure of the details but I'm able to switch screens to my other applications with my Remote Desktop session still on and the AutoIt script functioning well on the remote PC. My suspicion is it's because I use a lower screen resolution on Remote Desktop so it's displayed in a window and I set the "Apply Windows key combinations" to "On the remote computer". My scripts also use Control* functions too but I'm not sure whether either one or both are required to get that kind of behavior.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...