xtypekeys

xtypekeys
Login

Send keys to the active X11 window
(alternative to xdotools, with better unicode support)

$ xtypekeys -h
Send keys to the active X11 window
Usage:
  xtypekeys [ -d <num> ] "<string>" "<string>"

Example:
  xtypekeys -d 10 "[Control]t" "[Control]l" \
            "search this" \
            "[Return]"
Options:
  -d uint
        delay between keystrokes (milliseconds)

Used mostly from emacs. Here's an elisp function using it, to interact with chrome:

(defun chrome-search (string)
  "Make a google search from Chrome"
  (interactive "sChrome search: ")
  (with-chrome
    (xtypekeys "[Control]t" "[Control]l" string "[Return]")))