1

I'm recording a screencast involving iTerm demo. During the demo I want to type some commands. Since it's hard to type them for real, I just copy them from a text file and paste them into iTerm.

It seems to me that it would look better if the commands would appear like they were typed and not pasted.

Is there a way to emulate typing symbols when I paste them from the buffer?

bmike
  • 235,889
kovalad
  • 85
  • Applescript grabbing the buffer one char at a time & typing it out longhand. [no clue where to start on parsing that, sorry, but will be some nasty repetitive for loop, 'nicely' slowing it down] – Tetsujin Jul 15 '22 at 17:08
  • "During the demo I want to type some commands. Since it's hard to type them for real,..." - what makes it hard to type the commands? – Aivar Paalberg Jul 15 '22 at 22:25
  • what makes it hard to type the commands?

    It make the screenrecording process harder. You don't want to record how you backspacing a typo. You want to keep the typing speed. And you (me, actually) want to type fast. My normal typing speed is not fast enough. I guess automation would cope better than a human!

    – kovalad Jul 16 '22 at 07:24

2 Answers2

2

Checkout https://asciinema.org

It's available on Homebrew & MacPorts, and records to a local file for local playback, or can be uploaded to a website for remote play via an embedded player.

The recorded files are plain text, and can be edited to remove typos if slickness is the aim!

You could prerecord the typing, then playback while recording in the screencast recording, then video edit to hide the start / stop.

You can see it in action here also, where BorgBackup use it to demo borg usage https://www.borgbackup.org/demo.html

brew install asciinema

  • Thank you, script & scriptreplay did the trick partly for me. asciinema looks great fo sharing on the web though! – kovalad Jul 18 '22 at 09:15
  • Thanks. Yes asciinema is based on script & scriptreplay, as ref'd in their docs. I suppose what they've done is taken it a stage further with the web element.

    One advantage is that the files asciinema produces are text based, so easily editable, whereas script's output is a sort-of binary.

    – Andy Griffiths Jul 18 '22 at 09:34
1

No, paste is an “atomic” operation where all the contents appear at once. The pathway in code from where this input comes to an application is entirely different than the pathway that processes keyboard events.

Yes, you could invent or buy software to take that atomic paste and then pick apart keystrokes, decide on a time interval and any variation to simulate “typing”. So you could have someone waiting at the loading dock for a thousand items and then shuffle them to the front door and send those items in, one by one in order they were loaded into the truck.

The tool for this would need to be sophisticated like 1Password or TextExpander in the way it saves clipboard settings, does an expansion from the contents and optionally pops back the previous contents it saved. How to write this code has been done, just not sure anyone markets that feature the way you would need it to be implemented to aid in making your demonstrations clean and realistic.

Keep in mind, the clipboard contains data that can not be typed like images, styled text and more.

bmike
  • 235,889