Thanks for checking on that.
Well first I tried going with quicktime 7 and I was able to piece together the meat of the code despite as always Apple's suck documentation.
Code:
tell application "QuickTime Player 7"
activate
set endd to duration of document 1
select document at 5300 to endd
trim document 1
I have no idea what the "5300" is. It's not the frame, and it's not seconds, but it's equivalent to a bit less than 8.5 seconds.
But when I tried to add in export commands, or put this into the automated code that Kryten2 wrote, it gives me errors and roadblocks.
Code:
set srcFolder to choose folder
set dstFolder to choose folder with prompt "Choose the destination folder for the trimmed files." default location srcFolder
tell application "Finder"
set fileList to files of folder srcFolder
end tell
repeat with f in fileList
tell application "QuickTime Player 7"
open f
set documentName to name of f
set endd to duration of document 1
delay (0.25)
tell document 1
select document at 5300 to duration
trim
export of file ((dstFolder as text) & documentName) using settings preset "Sound to AIFF"
(*
close saving no
*)
end tell
end tell
end repeat
This opens the movie in Quicktime Player X rather than 7, but then 7 tries to do the work and errors out.
SO I moved back to the Quicktime Player X original code, thinking maybe I could just have it save the trimmed file rather than export it. It's not ideal for actually learning ANYTHING but it would get what I want to get done, done.
Code:
#export in file ((dstFolder as text) & documentName) using settings preset "480p..."
save in file ((dstFolder as text) & documentName)
But, saving just generates a permissions error.
The document Untitled 2 could not be saved as test.mp4. You dont have permission.
To view or change permissions, select the item in the Finder and choose File > Get Info.
(Of course, changing the original file permissions did nothing).
I guess I'll try GUI scripting next...joy.