Expect to send the Ctrl+A to the browser

109 views Asked by At

I want to start google-chrome and then send the Ctrl+A to the chrome process, to begin recording with ScreenCastify. I have set the shortcut key for the ScreenCastify to Ctrl+A. Following is the code snippet I have used:

!#!/usr/bin/expect
spawn google-chrome --new-window <url>
send "\x01";
interact

The Ctrl+A is not triggering the recording on the browser.

1

There are 1 answers

0
dfordevy On BEST ANSWER

Expect cannot work with GUI programs like Chrome. So, I used xdotool.