使用apple脚本旋转.mov文件

时间:2015-10-08 00:23:16

标签: applescript

这是一个苹果scrpit问题;

在Mac上运行我在网上找到了一个脚本,它应该有助于旋转我的MOV以使它们正常运行。

但是我无法接受它。

假设我想要合作的电影驻留在这里; /Users/pauldupuis/Documents/MTL/P1280602.MOV 我希望新旋转的电影在同一个文件夹/ Users / pauldupuis / Documents / MTL

有人可以为我填空,并将这些信息放在下面的脚本中,以便它可以工作吗?

tell application "QuickTime Player"
set m to (get movie 1)
rotate m by -90
save self contained m in (choose file name with prompt "save self contained movie")
end tell

1 个答案:

答案 0 :(得分:0)

Paul以下内容适用于Quicktime Player 7,您可以从Apple网站免费下载。

tell application "QuickTime Player 7"
    tell front document

        # Get the filename
        set mName to name

        # Get the full path
        set mPath to path

        # Get the full path of the folder file is in...
        try
            set mFolder to (do shell script "dirname " & mPath)
        on error eStr
            log eStr

            beep

            # oh no, something went wrong...
            return
        end try

        # Prepare new filename
        set dotPos to offset of "." in mName
        set fName to text 1 thru (dotPos - 1) of mName
        set fExt to text (dotPos) thru -1 of mName
        log fName & " - " & fExt

        set newFile to mFolder & "/" & fName & "-rotated" & fExt


        # Do rotation       
        rotate track "Video Track" by -90

        # Save to new file...
        save self contained in (newFile as POSIX file)
    end tell
end tell