首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Applescript : Quicktime导出到720

Applescript : Quicktime导出到720
EN

Stack Overflow用户
提问于 2018-11-16 02:24:47
回答 1查看 519关注 0票数 0

在QT中打开文件并使用export720p命令时,需要使用脚本/automator操作来寻找帮助(实际上是要做的)。我不想使用内置在查找器中的编码特性。在QT中使用我正在处理的文件中的“导出”功能可以完成这个任务,并且不会重新编码这些文件。我试过使用automator,但没有“导出”操作,只有“编码”,重新编码的文件。

我在字典里看到了这个命令,但似乎无法使它起作用。

我看到了很多脚本帮助,但大部分是针对QT 7和Pro的。对X来说就不一样了

这个是可能的吗?

提前感谢你的才华和技巧,

干杯!

EN

回答 1

Stack Overflow用户

发布于 2018-11-16 07:42:28

要查找QuickTime Player Applescript字典,使用如下脚本中的导出命令看起来非常简单:

代码语言:javascript
运行
复制
set MyFile to choose file name  -- open save as dialog to fill path and file name
tell application "QuickTime Player"
    activate
    export (document 1) in MyFile using settings preset "720p"
end tell

但是,如果QuickTime正确地执行了导出(您可以看到QuickTime导出的进度条),如果目标文件夹是my Desktop,则总是出现错误(没有写入导出文件的权限)...even!

我认为这是QuickTime Applescript命令中的一个bug。也许有人知道怎么处理这件事?

然后,我使用了一个关于GUI脚本的工作。我试图避免GUI脚本,但在这种情况下,我没有找到如何。因此,脚本必须模拟用户单击导出菜单,然后填充“另存为”对话框。这样做,QuickTime就没有权限问题了!

下面是有许多注释的脚本:

代码语言:javascript
运行
复制
set FileName to "test720p" -- your file name for the 720p exported video
set DestFolder to "myFolder/mySubFolder" -- path from Documents folder (folders should exit !!)
tell application "QuickTime Player" to activate
tell application "System Events" to tell process "QuickTime Player"

    --click menu 720p  of menu "Export" which is item 16 of menu File which is 3rd menu of main menu bar
    click menu item 2 of menu 1 of menu item 16 of menu 1 of menu bar item 3 of menu bar 1
    delay 1 -- leave time to open save as dialog

    -- need to fill the save as dialog box
    keystroke "h" using {command down, shift down} -- go home directory
    keystroke "g" using {command down, shift down} -- go-to dialog
    keystroke DestFolder
    keystroke return -- close go-to dialog
    keystroke FileName -- fill save as file name on top
    keystroke return -- close the save-as dialog    
end tell

标准保存对话框中还有其他命令键(可转到其他标准文件夹)。取决于你如何适应你的需要。确保您的文件夹在DestFolder之前已经创建好了!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53330568

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档