1

Im trying to send keystrokes and mouse movements to a Java program but once the applicaton has focus nothing is sent. It's as if the Java application takes focus of everything because Autohotkey stops responding. Everything works fine in a regular Windows app (e.g. Notepad).

I've tried using various send methods (Send, SendInput, and SendEvent) but nothing works. Does anyone have any suggestions?

The program in particular is ThinkOrSwim's ThinkDesktop.

user4157124
  • 2,809
  • 13
  • 27
  • 42
Jason Wirth
  • 745
  • 1
  • 10
  • 17
  • Perhaps this doesn't work. I tried switching from Autohotkey to Autoit and the problem persisted. Searching more I found this [StackOverflow threaod](http://stackoverflow.com/questions/5289708/use-autoit-with-java-applications). – Jason Wirth Mar 21 '11 at 02:15
  • Possible duplicate of [How do I automate a Java application with AutoHotkey?](https://stackoverflow.com/q/17564086/3357935) – Stevoisiak Oct 13 '17 at 18:52
  • Posting a comment to say that AutoHotKey does not like to work with ThinkOrSwim on Windows. I've had no luck. It seems as if AHK can't get focus or whatever. I presume it's because the TOS developers didnt want people script trading. – Everett Oct 04 '18 at 04:56

3 Answers3

2

I was able to get my script running with ThinkOrSwim by running the SciTE editor as Administrator [or running the compiled scripts as Administrator].

The TOS UI had some refresh issues but my scripts went through fine to do what I needed to do.

1

Some playing around I've discovered that TOS on Mac OSX can be controlled via scripting with Keyboard Maestro. It's a ugly, hacked solution, but it works. You can edit text boxes and click stuff if you know the X,Y position of elements.

Keyboard Maestro can be run via scripts (AppleScript, Python, etc.) so maybe you can build some elaborate rube goldberg.

Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
Jason Wirth
  • 745
  • 1
  • 10
  • 17
0

I suggest you use Easy Macro Recorder

http://download.cnet.com/Easy-Macro-Recorder/3000-2094_4-10414139.html

Its a great tool to automate keystrokes and mouse movements. Hope this helps :)

Karthik S
  • 847
  • 1
  • 8
  • 22