Hi there. I found the following Applescript online and I am desperate to use it. I have over 1,000 video files that I need to trim the first 6 and last seconds of. I saved this Applescript as a script, but it has multiple errors. Admittedly, I do not have any real script knowledge. Can someone please review this and let me know how to get this going. I sincerely appreciate your help.
set secondsFromStart to 6
set secondsFromEnd to 6
set shortMoviesList to {}
set srcFolder to choose folder
tell application "Finder"
set fileList to files of folder srcFolder
repeat with f in fileList
tell application "QuickTime Player"
open f
tell document 1
-- Check to make sure we're not trimming more time than the movie contains
set timeScale to timescale
set trimmedTime to (timeScale * (secondsFromStart + secondsFromEnd))
if trimmedTime is greater than duration then
-- Not enough content to trim, add file name to a list
set end of shortMoviesList to (the name of f as string) & return
else
-- We have enough content, proceed to trimming
set selection start to (timeScale * secondsFromStart)
set selection end to (duration - (timeScale * secondsFromEnd))
trim
save
end if
close
end tell
end tell
end repeat
if length of shortMoviesList is greater than 0 then
tell application "Finder"
-- bring Finder to front so dialog is not hidden
activate
end tell
display dialog "The following movies could not be trimmed because they do not contain enough content: " & return & return & shortMoviesList with icon caution
end if
end tell