Hello all,
I had a couple of scripts running, ever since macOS Yosimite I think, that now seem to fail after migrating to Catalina.
Here is what happens:
I have a TV-recording-file of about 2 hour long that contains Flower Power clips.
I have defined start- and stop-positions of each clip and have an applescript that takes care of the trimming.
As I said, the script has been running fine for years, but now I cannot get it to work any longer.
The script:
set savePath to (the path to the desktop folder as text) & “__716.m4v”
set unixFile to “/Volumes/4TP1/BackUp/Top40/1111-11-11.m4v”
set macFile to POSIX file unixFile
tell application “QuickTime Player”
activate
try
stop the front document
close saving no
close the front document
end try
open macFile
set theDuration to the duration of the front document
delay 4
set tDoc to open file macFile
tell tDoc
set current time to theDuration
delay 4
– position at the title, just for a nice preview
set current time to 731
delay 4
do shell script "echo " & “‘==== theDuration = " & theDuration & " ====’ > /tmp/debug_out”
do shell script "echo " & “‘trim from 716 to 1082’ >> /tmp/debug_out”
trim from 716 to 1082
end tell
delay 4
export the front document in file savePath using settings preset “1080p”
delay 4
try
stop the front document
close the front document without saving
end try
end tell
The delays and shell-script lines are there just for myself, just to be able to find out what is going on.
The lines:
set current time to theDuration and
set current time to 731
are there, just to make sure the start- and endpositions are OK, and they are! QuickTime Player flawlessly positions on both frames.
When running the script however I get:
% osascript < _Applescript_8134_trim
767:788: execution error: QuickTime Player got an error: End time must be less than or equal to duration (6)
/tmp/debug_out contains:
==== theDuration = 7187.04 ====
trim from 716 to 1082
I have tried integer as well as float representations of the start- and stop-numbers but nothing seems to work anymore.
Anybody any clues on to how to get it going again? Thanks!
Model: MacBook Pro (late 2013), macOS 10.15.4
Browser: Safari 605.1.15
Operating System: macOS 10.14