homeresourcesOther utilsQuickTimeTrack delay


Set track start delay (opensource script for QuickTime Player)
Did you experienced a sync issue when listening to a movie with QuickTime Player, because of a wrong sync on the movie itself?
I did it.

Extract tracks, add a silent, paste and scale... can be fixed, but it isn’t very comfortable. This is why I wrote this script.

By using this simple Applescript it’s quite easy to set up a precise delay in the initial reproduction of every movie track, both audio and video.

The code

on run
   set mylist to {}
   tell application "QuickTime Player"
       set theMovie to document 1
       set theMovieName to name of theMovie
       set timeScale to (time scale of theMovie)
       repeat with _t in every track of theMovie
           get "" & (index of _t) & " " & (type of _t) & " " & ¬
               (data format of _t) & " " & (language of _t)
           set the end of mylist to the result
       end repeat
   end tell
   tell me to activate
   set ttd to (choose from list mylist with title ¬
       "Choose in " & theMovieName with prompt ¬
       "Set the start delay for:" without multiple selections allowed and empty selection allowed)
   if ttd is false then return
   set ttd to (the first word of (ttd as text)) as integer
   tell application "QuickTime Player" to set dda to start time of track ttd of theMovie
   set da to the the text returned of (display dialog "Integer, " & timeScale & " = 1 sec" & return & ¬
       return & "Set “" & (item ttd of mylist) & "” to:" with title "Start Delay" default answer dda ¬
       with icon POSIX file (POSIX path of (path to application "QuickTime Player") & ¬
       set da to (word 1 of da) as integer
   on error
   end try
   tell application "QuickTime Player" to set start time of track ttd of theMovie to da
end run

Hot-to use it

Save the above code as an applet, and run it as needed.

As an alternativa you can save it as a script (or download the script from the side column), then follow this path and create folders as needed:
    ~/Library/Scripts/Applications/QuickTime Player/
Inside the last folder, copy the script fie.

Finally go to Script Utility, and enable the Script Menu.
Now when in QuickTime Player we’ll see the script menu, listing our script.

© and Credits

Original software by faqintosh.com
Author: Marco Balestra
This software is povided "as is", without warranty.
It is freeware, but not public domain: in order to redistribute it author's clearance is required.

© and Credits


Set track start delay.scpt