Evangelism Reps Training Program/How to prepare a screencast: Difference between revisions

Line 82: Line 82:


To assign a keyboard shortcut to the script, so it runs when you press the shortcut, you can use a tool like [http://www.red-sweater.com/fastscripts/ FastScripts].
To assign a keyboard shortcut to the script, so it runs when you press the shortcut, you can use a tool like [http://www.red-sweater.com/fastscripts/ FastScripts].
You can also automate reading a file and printing it out to the editor. Sublime Text/Textmate is a bit too clever with auto-indenting and closing of curly braces, so I am using Brackets for that. The script is:
  set fileContents to read POSIX file "/your/script/location/script.js" as «class utf8»
  set the text item delimiters to (ASCII character 10)
  set mylines to text items in fileContents
  repeat with currentline in mylines
    write_string(currentline)
  end repeat
  on write_string(the_string)
    tell application "System Events"
      tell application "Brackets Sprint 15" to activate
      repeat with the_character in the_string
        keystroke the_character
        delay 0.05
      end repeat
      key code 36
      key code 123 using command down
    end tell
  end write_string
You can see this in action here: https://www.youtube.com/watch?v=XTkZug-6hPY


==Publishing==
==Publishing==
Confirmed users
376

edits