Input keyboard keys upon program launch

Hey guys, first post! I want to write a script that will wait 1 second and then input the keys CTRL+ALT+J to the application i just opened.

The program is dosbox, and thay key combination starts video recording :slight_smile: I have no idea how to program this, can anyone help please?

thanks in advance!

You could use "expect" for this kind of tasks. See the documentation of "expect" and download and install it onto your system if it isn't already there.

I hope this helps.

bakunin

thank you! i will read about that, in the meanwhile, i was able to figure out how to do it on vbscript. The script itself launches the application, waits a little bit, and then sends keys, something like this for bash would be perfect to me! Gonna do some research and post results when i do find some

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "dosbox", 9
WScript.Sleep 1500 
WshShell.SendKeys "^j"