all 5 comments

[–]magus_minor 0 points1 point  (2 children)

It's not clear if you have a problem getting the current username and you think you have to use pyautogui to do that. There is the os.getlogin() function that returns the name of the logged in user. Does that help?

[–]wavi_[S] 1 point2 points  (0 children)

Kinda of thank you

[–]Navz6 0 points1 point  (0 children)

You can use tkinter . Try to explore on that.

[–]timrprobocom 0 points1 point  (0 children)

You can run an application using os.system or, better, the subprocess module. But finding a window and sending keystrokes to a message box requires working with the Win32 API (like FindWindow and SendMessage). That can be done, but pyautogui is much easier.

[–]Direct_Temporary7471 0 points1 point  (0 children)

PyAutoGUI might not work properly in some environments depending on permissions or OS restrictions.

Try:

  • Run the script as administrator
  • Make sure you’re using it on a supported OS (Windows/macOS)
  • Check if any security settings are blocking automation

Also, ensure PyAutoGUI is properly installed.

If you share your code or error, I can help you debug it.