Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use AppleScript to create QuickTime transcription aids System
My wife has to do transcription and most of the players are for Windows, and the free one that comes with the pedal doesn't work well. This is a hack to create a pedal-like environment on the keyboard for transcribing Audio/Video files in QuickTime using four AppleScripts (PlayPause, FastForward, Rewind, and Pause).

These scripts run a QuickTime movie in the background and allow for simple keyboard control of the playback while in another application (e.g. MS Word, TextEdit, or any other). The scripts are used in combination with Keyboard Maestro, which allows you to assign AppleScripts to keyboard shortcuts. I assigned each of the following scripts a shortcut. Before using the scripts, open the file you want to transcribe in QuickTime. Make sure it's the active movie.

The four scripts each control a different aspect of playback behavior:
  1. PlayPause: Plays, pauses, and backspaces for 1.5 seconds by pressing one shortcut key (e.g. Option + Spacebar). Press the key, the movie plays. Press the key again, the movie goes back 1.5 second and pauses.
    tell application "QuickTime Player"
    if the movie 1 is playing then
    stop movie 1
    set the current_time to current time of movie 1
    set current time of movie 1 to (the current_time -
    1.5 * (time scale of movie 1))

    else
    play movie 1
    end if
    end tell
  2. FastForward: Fast forwards at two times the speed. Second press will pause the movie.
    tell application "QuickTime Player"
    if the movie 1 is playing then
    stop movie 1
    else
    set rate of movie 1 to 2.0
    end if
    end tell
  3. Rewind: Rewinds at four times the speed. Second press will pause the movie.
    tell application "QuickTime Player"
    if the movie 1 is playing then
    stop movie 1
    else
    set rate of movie 1 to -4.0
    end if
    end tell
  4. Pause: Backspaces for 1.5 seconds and pauses (no matter what the movie is doing).
    tell application "QuickTime Player"
    if the movie 1 is playing then
    stop movie 1
    else
    set rate of movie 1 to -4.0
    end if
    end tell
Create the scripts using AppleScript Editor, of course!
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[17,265 views]  

Use AppleScript to create QuickTime transcription aids | 4 comments | Create New Account
Click here to return to the 'Use AppleScript to create QuickTime transcription aids' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Listen&Type
Authored by: Hart on Sep 23, '02 07:28:44PM

Another way to deal with transcription is with the application Listen&Type, available for OS X. It attaches any sound file to a simple text processor. I tape interviews and/or record them to hard drive, convert that sound file to MP3, then use Listen&Type to transcribe. I usually then copy the text and paste into a full-fledged word processor.



[ Reply to This | # ]
Use AppleScript to create QuickTime transcription aids
Authored by: ptamas on Sep 16, '03 08:51:13PM

Working with Keyboard Maestro I've come up with the following...it uses time displacement rather than fastforward and rewind (step forward about 3 second, step back about 3 seconds etc.) and one script copies the timecode to the clipboard...it takes a two step macro to make that one work (explained below)
here they are

step forward
tell application "QuickTime Player"
if the movie 1 is playing then
step forward movie 1 by 10
play movie 1
else
step forward movie 1 by 10

end if


end tell

step backward
...just edits two lines replacing
step forward movie 1 by 10
with
step backward movie 1 by 10

play pause looks like this

tell application "QuickTime Player"
if the movie 1 is playing then
stop movie 1
step backward movie 1 by 5
else
play movie 1
end if
end tell

now the brute is inserting the timecode...the macro for keyboard maestro set up for TAMS looks like this
1. run the 'timecode' Apple Script
2. Insert Text '{timecode}%CurrentClipboard%{/timecode}

and the script looks like this

tell application "QuickTime Player"
try
if not (exists movie 1) then error "No movies are open."

-- CHECK FOR THE CORRECT VERSION
set QT_version to (QuickTime version as string)
set player_version to (version as string)
if (QT_version is less than "5.0") or
(player_version is less than "5.0") then
error "This script requires QuickTime 5.0 or greater." &
return & return &
"Current QuickTime Version: " & QT_version & return &
"Current QuickTime Player Version: " & player_version
end if

-- CHECK FOR QUICKTIME PRO
if QuickTime Pro installed is false then
set the target_URL to "http://www.apple.com/quicktime/download/"
display dialog "This script requires QuickTime Pro." & return & return &
"If this computer is currently connected to the Internet, " &
"click the "Upgrade" button to visit the QuickTime Website at:" &
return & return & target_URL buttons {"Upgrade", "Cancel"} default button 2
ignoring application responses
tell application "Finder"
open location target_URL
end tell
end ignoring
error number -128
end if

set this_movie to the name of movie 1
set this_time to the current time of movie 1
set movie_scale to the time scale of movie 1
set this_timecode to my time2timecode(this_time, movie_scale)
set the clipboard to this_timecode
on error error_message number error_number
if the error_number is not -128 then
beep
display dialog error_message buttons {"Cancel"} default button 1
end if
end try
end tell

on time2timecode(this_time, movie_scale)
set the total_seconds to this_time div movie_scale
set the partial_seconds to this_time mod movie_scale

set hours2 to total_seconds div 3600
set hours1 to my add_leading_zeros(hours2, 1)
set minutes2 to (total_seconds - (hours2 * 3600)) div 60
set minutes1 to my add_leading_zeros(minutes2, 1)
set seconds2 to (total_seconds - (minutes2 * 60)) div 1
set seconds1 to my add_leading_zeros(seconds2, 1)
set partial_seconds to my add_leading_zeros(partial_seconds, 2)

set AppleScript's text item delimiters to ":"
set new_timecode to {hours1, minutes1, seconds1} as string
set AppleScript's text item delimiters to ""
set new_timecode to (new_timecode & "." & partial_seconds) as string

return ("[" & new_timecode & "]") as string
end time2timecode

on add_leading_zeros(this_number, max_leading_zeros)
set the threshold_number to (10 ^ max_leading_zeros) as integer
if this_number is less than the threshold_number then
set the leading_zeros to ""
set the digit_count to the length of ((this_number div 1) as string)
set the character_count to (max_leading_zeros + 1) - digit_count
repeat character_count times
set the leading_zeros to (the leading_zeros & "0") as string
end repeat
return (leading_zeros & (this_number as text)) as string
else
return this_number as text
end if
end add_leading_zeros

there...that is it. This last script is a crib from the scripts available from apple.com

-peter




[ Reply to This | # ]
Use AppleScript to create QuickTime transcription aids
Authored by: arossello on Apr 27, '08 05:08:02PM

Hi,

Using AppleScript, I'm trying to extract the actual timecode that is reported by the 'Timecode: Non-Drop-Frame' setting in Quicktime.

Can someone tell me if this is attainable? It seems I'm only able to get the 'standard' timecode, as described in the posts here.

Thanks,

Tony



[ Reply to This | # ]
Use AppleScript to create QuickTime transcription aids
Authored by: inakaboy on Nov 17, '12 08:39:36PM

I used Listen&Type for years and it helped me pay my way through college. :)

Now that it doesn't work on Intel Macs, these scripts were a godsend! I can more or less duplicate the rather smart defaults of the original Listen&Type. The below macros do the following:
- TAB goes back 3 seconds
- SHIFT-TAB stops and starts the audio
- CONTROL-TAB toggles the macros

Howto:
- Download QuickTime Player 7 from Apple and enter the pro key
- Get Keyboard Maestro
- Configure three macros as follows:
1. transcription step back -- "This hot key" - "Tab" --> Execute Applescript. Paste in:
tell application "QuickTime Player 7"
if the movie 1 is playing then
step backward movie 1 by 10
play movie 1
else
play movie 1
end if
end

2. transcription stop/start - "This Hot Key" - "Shift-Tab" --> Execute Applescript. Paste in:
tell application "QuickTime Player 7"
if the movie 1 is playing then
stop movie 1
else
play movie 1
end if
end

3. transcription enable/disable - "This hot key" - "Control-Tab" --> put two "Set Macro or Group Enable" actions in there, set "Toggle Macro", and make it toggle the previously configured two macros.

One detail, I can't figure out how to properly get it to start/stop using shift-tab or shift-return as when you lift the shift key, it seems to run the macro again. I might just assign it to another key.

With these macros I can happily transcribe on my laptop. :)



[ Reply to This | # ]