Is a script to merge several videos with quicktime player possible?

i tried a free chatgpt script but kept getting syntax errors and i know nothing about scripting.
so i was wondering is there a way to merge all mp4 files in a specific folder using QuickTime player whilst keeping the first files name?

Revised: After digging around a bit, I donā€™t think it is possible to script quicktime player that way.

Apparently, it once was. If you search here for something like ā€˜quicktime mergeā€™, you should see multiple solutions for this problem. It looks like apple has slowly removed access to many features of quicktime by scripting.

It would likely be possible to create a kludge of a script using UI scripting though.

Do you have the ability to install command line tools? If so, this would be a trivial task using mp4box or ffmpeg.

Update: It is possible to concatenate files using UI scripting. I just made a script to do that. However, saving such a file is a monstrosity in quicktime player as it seeks to re-encode the entire mess, which takes a long time and makes for an absurdly large file. Iā€™m not sure whether quicktime player has any scriptable means of saving a video without re-encoding it, or at least the ability to save with a size that corresponds to the inputs.

@StefanK Thanks for the explanation. Iā€™d tried to use the example that Iā€™d linked to initially but obviously, it wouldnā€™t work. While casting about for other solutions, I
had begun to edit my post and only after finishing did I see your post.

1 Like

Unfortunately the current version of QuickTime Player doesnā€™t contain the rewind and select commands anymore. The script (from 2006!) refers likely to the predecessor app which has been renamed later as QuickTime Player 7.

1 Like

In the Save or Save As Menu there should be an option to select ā€œas reference / new movieā€ or something like that. (At least there was in QuickTime 7). When you save as reference it references the other files, so donā€™t delete them. QuickTime 7 has better scripting capabilities. I can set you up with QT7 if you like

I would recommend this route. Once you get the proper shell script command worked out. (I may be able to help with this) You can get substitute the folder name in the command and run it.

Most likely though it will probably copy the media to the new file though.