8

I am creating some screencasts and as I have been doing this I realized that there must be some way of pasting code from pasteboard and having it appear in my text editor as though I'm typing it so that my typing is more fluid...

Unfortunately I've not found any solutions yet. Anyone seen any software that does something along these lines?

Again, the desired effect is upon paste or some key combo it will type what I have in the pasteboard buffer to whatever text field or editor I have up.

6

You can use an Applescript (free, built into System 7, Mac OS 8, Mac OS 9, Mac OS X) script:

Applescript:
try
   the clipboard as text
on error
   set the clipboard to " "
end try

tell application "System Events"
   keystroke (the clipboard as text)
end tell

To add some delay between each keystroke:

Applescript:
try
   set getClip to the clipboard as text
on error
   set getClip to " "
end try

tell application "System Events"
   repeat with i from 1 to count characters of getClip
       keystroke (character i of getClip)
       delay 0.03
   end repeat
end tell

(Source)

(no Mac right now around me to debug)

On Windows you can do pretty much the same with AutoHotKey.

  • Sorry for the late acceptance; forgot about this question some time ago and came back to it later on again. Applescript seems to work well for this task, thanks. – GDP2 May 14 '16 at 21:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.