RPA / Robocorp

Keyboard / Type

Type a text and use hotkeys

tasks.py
Copied!

from robocorp.tasks import task
from robocorp import windows

@task
def keyboard_type_and_hotkeys():
  # Open Notepad (or other app of your choice)
  desktop = windows.desktop()
  desktop.windows_run("notepad.exe")
  app_window = windows.find_window('subname: "Notepad"')

  # Typing: write a text
  app_window.send_keys('Hello world. {Enter}')

  # Hotkeys: select all, copy and paste it
  app_window.send_keys('{Ctrl}a{Ctrl}c{Ctrl}v')