Latest in Applescript

Image credit:

Simplify media transcription with hotkeys and AppleScript


I've found myself transcribing different types of media lately; primarily recorded Skype conversations and footage from interviews. I do a lot of work in Scrivener, an application so enjoyable that it makes me want to write a lot more than I do. Scrivener allows for a split pane editor with a QuickTime media file loaded in one pane, and your current document in the other. While you type you can hit Shift-Space to start and stop the media. I loved it, but I wanted to take it to another level. There are applications specifically designed for this, but why not have a system-wide, works-with-anything solution?

Find out how I did it after the jump.

To pull this off we need a couple of things. First, we need to be able to assign hotkeys to scripts. There are a plethora of apps for handling this task, such as Keyboard Maestro and FastScripts, both of which are excellent programs. If you've already got an app that can do this, great. If not, I'd like to recommend something I recently discovered: a small daemon/application combo called Spark. It's not as powerful as some other programs, and its interface has some spelling and grammar issues, but I've found it to be smooth, effective and unobtrusive. Plus, it's free, which makes it great for little experiments like this. It can assign just about any key combination to an AppleScript, an application, a document, iTunes controls, keyboard macros, and some system functions.

The plan here is to use QuickTime Player to play back our media in the background while we type in a foreground application. We'll use AppleScript to provide 3 main functions: play/pause, jump back and jump forward. It's key to pick 3 key combinations you can comfortably access while your hands are already roaming the keyboard. My choice was a little awkward, but the muscle memory developed quickly: F13, F14 and F15 on my Apple keyboard (jump back, play/pause, jump forward). I also assigned Shift-F13 and Shift-F15 to execute their respective tasks in higher increments.

Here are the scripts:

Jump back:

tell document 1 of application "QuickTime Player" to set current time to (current time - 2500)


tell document 1 of application "QuickTime Player"
if playing is true then
end if
end tell

Jump Forward:

tell document 1 of application "QuickTime Player" to set current time to (current time + 2500)

The Shift-Fxx functions just repeat the back/forward scripts with a value of 5000 instead of 2500. You can make these any values you like. You could also make Shift-F14 (or whatever your play/pause key is) tell QuickTime to rewind, which rewinds to the start of the clip. Salt to taste.

In your hotkey-generating application, assign these to the keys you've chosen. When deciding on keys, also consider any conflicts that might arise in any of your favorite text editors. You could also, were it more your style, use complex key combinations and assign an external controller (Shuttle Xpress, PowerMate, a many-buttoned mouse, etc.) to trigger them.

If you're using Spark, you can just paste the scripts directly into the editor that comes up when you add an AppleScript action. In most other programs, you'll need to paste them into Script Editor, save it as a script, put it somewhere for safekeeping and then link to it. However you end up doing it, the end result should be a set of system-wide hotkeys that will trigger AppleScripts to control QuickTime Player in the background.

Now you can just open up the media to be transcribed in QuickTime Player, fire up your favorite text editor or word processor and hit your play/pause hotkey. Type a bit, pause when you need to, and rewind when you want to. I can see you're itching to knock out some transcriptions of your own now. Well, have at it.

From around the web

ear iconeye icontext filevr