从QuickTime导出到bath的AppleScript:Can';不能将其导出为.mov而不是.mp4

从QuickTime导出到bath的AppleScript:Can';不能将其导出为.mov而不是.mp4,applescript,quicktime,Applescript,Quicktime,我需要将大量的.avis导出/压缩到.mov 我发现下面的动作脚本(取自)就是这样做的 它成功地从桌面上名为“输入”的文件夹中获取视频,并将其导出到桌面上名为“导出”的文件夹中 唯一的问题是,它并没有导出我在Quicktime中使用的“最新设置”。此外,它将其导出为.mp4而不是.mov 注意:原始脚本确实说: export front document to output_file as MPEG-4 但我把它改成: export front document to output_file

我需要将大量的.avis导出/压缩到.mov

我发现下面的动作脚本(取自)就是这样做的

它成功地从桌面上名为“输入”的文件夹中获取视频,并将其导出到桌面上名为“导出”的文件夹中

唯一的问题是,它并没有导出我在Quicktime中使用的“最新设置”。此外,它将其导出为.mp4而不是.mov

注意:原始脚本确实说:

export front document to output_file as MPEG-4
但我把它改成:

export front document to output_file as QuickTime movie
它仍然以mpeg-4格式输出

完整脚本:

with timeout of 86400 seconds

    display dialog "Before beginning batch processing, make sure QuickTime Player is set to the desired export settings, and all videos to be processed are in a folder named ‘Input’ on the desktop." with icon note

    tell application "Finder"
        set the startup_disk to the name of the startup disk
    end tell

    set user to do shell script "whoami"
    set input_folder_name to "Input"
    set input_folder to startup_disk & ":Users:" & user & ":Desktop:" & input_folder_name & ":"
    set user_desktop to startup_disk & ":Users:" & user & ":Desktop:"
    set output_folder to startup_disk & ":Users:" & user & ":Desktop:Output:"
    set file_extension to "_export.mp4"

    try
        tell application "Finder"
            make new folder at user_desktop with properties {name:"Output"}
        end tell
    end try

    try
        set the_folder_list to list folder input_folder without invisibles
        repeat with x from 1 to count of the_folder_list
            set the_file to input_folder & item x of the_folder_list
            set output_file to output_folder & item x of the_folder_list & file_extension
            tell application "QuickTime Player"
                activate
                open the_file
                export front document to output_file as QuickTime movie using most recent settings with replacing
                close front document
            end tell
        end repeat
    on error
        display dialog "This script requires a folder named ‘" & input_folder_name & "‘ located on the desktop." with icon stop
    end try

    beep

end timeout

只是快速拍摄,但您可以尝试更改以下行

set file_extension to "_export.mp4"


不知道这是否会奏效,但可能会有所帮助。

您应该使用组合

将文件扩展名更改为.mov(正如Bjoern所说),并将MPEG-4更改为Quicktime电影

您的更改会将电影导出为MOV文件,但不会更改文件扩展名。(如果您尝试使用仅限MOV的播放器打开它,它应该能够播放电影)


干杯,

如果您想要比仅使用以前的设置更好的控制,您可以保存导出设置。使用所需的设置设置导出,然后使用

tell quicktime player
    tell movie 1
        save export settings for Quick Time Movie to mysettingsfile--or whatever format you exported to
    end tell
end tell
我不知道为什么必须指定文档而不是应用程序,但字典中就是这样。
您也可以使用(免费)或(FOSS,仅限命令行,但GUI确实存在)之类的程序来做同样的事情。MPEG Streamclip附带一个批处理列表功能,可以将几乎所有内容转换为任何其他内容。省去了重新发明轮子的麻烦。

MPEG4容器是一部QuickTime电影。这只是一部标准化的现代QuickTime电影。如果您有一个扩展名为“.mp4”的文件,只需将其更改为“.mov”即可。但没有理由这么做。“.mp4”表示“QuickTime电影+”——它表示“我不仅仅是一部QuickTime电影,我是一部标准化的现代QuickTime电影。”您应该关注的主要问题不是电影容器,而是容器中视频轨迹的转换。也就是说,将过时的AVI编解码器视频曲目转换为现代H.264编解码器视频曲目。
tell quicktime player
    tell movie 1
        save export settings for Quick Time Movie to mysettingsfile--or whatever format you exported to
    end tell
end tell