Quicktime add to selection and scale...

We have a number of videos that need to have closed captioning .mov files added to them. Our process is to take two text files, one for English and one for Spanish, and drop them onto quicktime pro (they have a header and time codes for the captioning). This creates two mov files with the closed captioning in them, we select all and copy, then mosey on over to the video file itself and “add to selection and scale”. We get to do that process twice, once for English and once for Spanish. At that point we save the resulting video file with both closed captioning added and save it as a self contained movie. The movie file and English captioning file are the exact same name, and the Spanish file is the same name with _ESP at the end before the file extension. I did manage to put together a script that converts the txt files into movie files. Can anyone help me with building a script to combine the three mov files together and save it?

I know, this is a big crazy request…

Here is one script I found on here that sounds like the guy is trying to do something a little similar, but doesn’t look like he was able to figure out how to add to selection and scale. Is that even possible?

on open dropped_items
   tell application "QuickTime Player"
       activate
       close every window
   end tell
   repeat with this_item in dropped_items
       
       tell application "QuickTime Player"
           open this_item
           set poster_text_file_name to name of the front document as string
           set poster_text_export_location to this_item as string
           set poster_export_new_name to poster_text_export_location as string
           set poster_export_new_name to my remove_extension(poster_export_new_name)
           (export front document to (poster_export_new_name & "_tmp" & ".txt") as text file using settings preset "Text with Descriptors")
           
           close window poster_text_file_name
           open poster_export_new_name & "_tmp.txt"
           set poster_text_with_description_name to name of front document as string
           choose file with prompt "Your poster image file please:"
           open (result)
           select all last document
           copy last document
           select all front document
           add front document with scaled
           set name of last track of front document to "HREFTrack"
           set enabled of last track of front document to false
           close last document
           save self contained front document in poster_export_new_name & ".mov"
       end tell
   end repeat
end open

on remove_extension(this_name)
   if this_name contains "." then
       set this_name to ¬
           (the reverse of every character of this_name) as string
       set x to the offset of "." in this_name
       set this_name to (text (x + 1) thru -1 of this_name)
       set this_name to (the reverse of every character of this_name) as string
   end if
   return this_name
end remove_extension

When I run this script I get an error based on the movie 1, not sure what to do with that. If some one can just point me in the right direction on where to look for more information that would be helpful, or if you have any input to changing some of this code to get me closer to the end goal, you would be my hero!

Thanks!

Not sure if this is still something people are struggling with, but I also never found online a solution to scripting “Add to Selection & Scale” in QuickTime 7.

BUT…I have finally figured out how to do the “Add to Selection & Scale” with QuickTime 7. As background, for my projects I need to paste watermarks in the first several seconds of our movies by copying a transparent PNG file from the Preview app and placing it into my QuickTime movie file using “Add to Selection & Scale” and then changing the Transparency of the new “Video Track 2” track to “straight alpha” and finally exporting the movie to a new filename using a saved settings files. For my purposes I also needed to use System Events to access menus in Preview because it isn’t scriptable.

set this_picture to choose file
tell application “Preview”
activate
open this_picture
end tell
tell application “System Events”
tell process “Preview”
keystroke “a” using command down
keystroke “c” using command down
end tell
end tell
tell application “Preview” to quit

That copies the transparent PNG file I select into the clipboard

tell application “QuickTime Player 7”
activate
tell document 1
set selection start to 0
set selection end to my secondsToQTUnits(3) – sets selection to first 3 seconds of QT movie
end tell
end tell
tell application “System Events”
tell process “QuickTime Player 7”
keystroke “v” using command down & option down & shift down – “Add to Selection & Scale” !!
end tell
end tell
tell application “QuickTime Player 7”
activate
tell document 1
tell track “Video Track 2”
set transfer mode to straight alpha – sets transparency to the alpha of my PNG file
end tell
export to (exportMovieName) as QuickTime movie using settings exportSettingsFile with replacing
end tell
end tell

The last bit is just exporting this new QuickTime file to a name I set elsewhere in the script and using export settings saved to an external file using a snippet I got here awhile back, and of course “with replacing” means to overwrite whatever file is already there.

set exportSettingsPath to (path to desktop folder as Unicode text) & “ExportSettings”
tell application “QuickTime Player”
tell first document
save export settings for QuickTime movie to file exportSettingsPath
end tell
end tell

Hope someone finds this info that needs it.