Created
June 9, 2015 00:15
-
-
Save chetbox/1ae7686c9ca58f54c5b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Emulate a user in a terminal for the purposes of a video recording | |
# Waits 1 second for every blank line | |
tell application "Terminal" | |
activate | |
end tell | |
delay 1 | |
tell application "System Events" | |
set scriptContents to (read POSIX file "/Users/chetan/Desktop/terminal-script.txt" using delimiter linefeed as «class utf8») | |
repeat with scriptLine in scriptContents | |
if length of scriptLine is greater than 0 then | |
log scriptLine | |
repeat with scriptChar in characters of scriptLine | |
keystroke scriptChar | |
delay 0.06 | |
end repeat | |
delay 0.25 | |
keystroke return | |
delay 0.1 | |
else | |
delay 1 | |
end if | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment