This email is a bit off topic, but I thought it might be useful to any developers who are making screencasts. I've written a little ruby script called ghostwriter which uses apple gui event scripting to produce applescript that makes it looks like you're typing. I've found it very useful when for making demo code, because unlike me, the computer never makes a typo!
It's available at http://www.had.co.nz/ghostwriter/
Hadley
On 30/12/2005, at 21:37, hadley wickham wrote:
This email is a bit off topic, but I thought it might be useful to any developers who are making screencasts. I've written a little ruby script called ghostwriter which uses apple gui event scripting to produce applescript that makes it looks like you're typing. [...]
Very neat indeed -- Apple has a Demo Assistant [1] which they use in their WWDC sessions.
This is a service which reads from a text file and inserts the next line from that file in the current (service supporting) application (on a key press). This isn't as neat as your script, but I like the interactive part, so the actor can control the pace while the presentation is running.
If you like it as well, what you maybe could do was have a ---WAIT which would cause the script to read one byte from /tmp/ some_named_pipe (man 1 mkfifo) and then setup QS to write one byte to that pipe on a hotkey -- just thinking out load here…
Oh, and maybe insert random pauses in the text typed, so it looks more human :)
[1] /Developer/Examples/AppKit/DemoAssistant
If you like it as well, what you maybe could do was have a ---WAIT which would cause the script to read one byte from /tmp/ some_named_pipe (man 1 mkfifo) and then setup QS to write one byte to that pipe on a hotkey -- just thinking out load here…
Yes, that's a great idea. I could also add an option to wait after each line of text.
Oh, and maybe insert random pauses in the text typed, so it looks more human :)
I've tried to make the time between letters somewhat random, but I really need to tweak it some more. Ruby's random number generation facilities are rather primitive -- I'm used to R where it's easy to generate a random number from any distribution you can think of.
The other thing I'd really like is a keyboard logging script so I could empirically work out the gaps between letters and words and sentences to make it even more realistic.
Hadley