Automate clicks and typing on Windows apps without source code?

Click For Summary

Discussion Overview

The discussion revolves around the feasibility of creating a program that can automate typing and clicking in any Windows application without needing access to the source code. Participants explore various tools and methods that could facilitate this automation, including GUI testing frameworks and specific utilities.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant expresses a desire to automate repetitive tasks in Windows applications without source code access.
  • Another participant mentions using the KeePassXC Auto-Type feature as a method for automation.
  • Some participants suggest that GUI testing frameworks could be suitable for this purpose, providing a link to a resource on open-source UI testing tools.
  • A participant recalls using the Sendkeys utility, describing a potential method involving obtaining the application PID and sending keystrokes, while noting the need for pauses between commands.
  • Another participant shares their experience of creating a C program that utilizes Sendkeys, along with a Perl script for managing the automation process.
  • A participant recommends AutoHotkey as a tool for automation, providing a link to their previous work related to scripting.

Areas of Agreement / Disagreement

Participants present various tools and methods for automation, but there is no consensus on a single best approach. Multiple competing views and techniques remain, indicating an unresolved discussion.

Contextual Notes

Some methods discussed may depend on specific application characteristics, such as the need for class names in certain frameworks, and the effectiveness of Sendkeys may vary based on application design.

kolleamm
Messages
476
Reaction score
44
I want to create a program that can type and click for me on any Windows app without access to the source code. This would save a lot of time doing boring and repetitive tasks. Is this possible?
 
Computer science news on Phys.org
The Sendkeys utility is one way to send text to another Windows application. I have not used it in a long time. I remember(?) that you can use tasklist to get the application PID. Then set the focus to that PID. Then you need to use sendkeys to send tabs to move to the desired input box. Then use sendkeys to send the desired text. Some pause between sendkeys is needed.

PS. If the Windows app has command line options for what you want, that is probably much simpler.
 
  • Like
Likes   Reactions: kolleamm
kolleamm said:
Lots of good info here, not sure which one to choose, some seem to require knowing class names but I'll check them out, thanks.
When I was doing a lot of this, I made a small C program that took a command-line text in argv and called sendkeys to send it to the Windows application. Then I used a Perl script to do all the work and logic of getting the PID, calling my C program, and pausing between steps.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 51 ·
2
Replies
51
Views
7K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
10
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 104 ·
4
Replies
104
Views
7K
Replies
7
Views
3K
  • · Replies 26 ·
Replies
26
Views
4K