- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在寻找使用 Applescript 控制 Quicktime 的解决方案。我需要做的就是——- 打开quicktime并开始录音- 停止录制并将文件保存到设置的位置。
从以前的帖子中我设法得到以下内容。
set theFilePath to "/Users/jamestebb/Desktop/01TestRecords/ " & "myfile" & ".mov"
tell application "QuickTime Player"
set newMovieRecording to new movie recording
tell newMovieRecording
start
delay 5
pause
save newMovieRecording in POSIX file theFilePath
stop
close newMovieRecording
end
然而,这非常有效,对于这个项目,我需要单独的脚本提示来开始和停止录制,而不是等待/延迟。
开始我用的录音。
set theFilePath to "/Users/jamestebb/Desktop/01TestRecords/ " & "myfile" & ".mov"
tell application "QuickTime Player"
set newMovieRecording to new movie recording
tell newMovieRecording
start
end tell
end tell
这很好用,但是当我尝试使用下面的命令停止录制时,出现无法理解暂停的错误
set theFilePath to "/Users/jamestebb/Desktop/01TestRecords/ " & "myfile" & ".mov"
tell application "QuickTime Player"
set MovieRecording to new movie recording
tell MovieRecording
pause
save MovieRecording in POSIX file theFilePath
stop
close MovieRecording
end tell
end tell
我猜这是因为当前正在录制的文件不再是“新电影录制”
任何想法很快如何解决?
最佳答案
我使用以下示例 AppleScript 代码 来测试在QuickTime 中开始新电影录制使用第一个脚本播放器,然后使用第二个脚本对其进行处理以暂停、保存、停止和关闭 它。
脚本 1:
tell application "QuickTime Player" to start (new movie recording)
脚本 2:
set theFilePath to POSIX path of (path to movies folder) & "myMovie.mov"
tell application "QuickTime Player"
tell document "Movie Recording"
pause
save it in POSIX file theFilePath
stop
close
end tell
end tell
在这两个脚本之间,它成功地在电影 文件夹中创建了myMovie.mov 文件 我的家 文件夹。
测试是在 macOS High Sierra 下完成的。
注意:示例 AppleScript 代码 就是这样,不包含任何错误处理可能是适当的。用户有责任添加任何适当、需要或想要的错误处理。看看 try 声明 和error AppleScript Language Guide 中的声明 .另见,Working with Errors .此外,使用 delay command 在适当的事件之间可能是必要的,例如delay 0.5
,适当设置delay的值。
关于applescript - 使用 Applescript 控制 Quicktime,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61010274/
当我学习 Windows 的可移植可执行 (PE) 文件格式时,PE-Explorer 之类的工具和 PEView帮助我快速而良好地学习东西。现在,我需要学习和理解apple quick time 文
我正在尝试将一段音频从一部 QuickTime 电影复制到另一部,但没有成功;音频似乎没有被复制。 C++基本代码: // Copy from another QT movie, *src, to t
我将 macOS 更新为 Sierra,但我的一些文件消失了。最重要的是 Allegro 的图书馆。我正在尝试像我第一次安装时看到的视频( https://www.youtube.com/watch?
我通过向 webview 提供 youtube url 来运行 youtube 视频,webview 打开 youtube 视频并在点击时自动在 MPMoviePlayerController 中运行
所以在我们的应用程序中,上传后会显示视频预览。但是,在我的计算机上,我收到一个缩略图,上面写着“缺少插件”,经过进一步检查,它说要安装 quicktime 插件。 但是,Chrome 提供的安装插件的
我正在编写一个多路复用器,它采用 mpeg4 帧(和 h264)并将它们放入 mp4 容器中。我创建的视频 ( test1.mp4 ) 可以在 Windows 媒体播放器和 VLC 中成功播放,但无法
我尝试在我的 Mac 上播放简单的 mp3 文件 iPhone 模拟器。我使用 AVFoundation.framework 和 AVAudioPlayer。在我的一台 Mac 上,一切正常,但在另一
在页面上嵌入 Quicktime 视频作为 IE 系列浏览器(无 flash/html5)的优雅回退。稍后我有一个覆盖视频的 div,因此 Quicktime 嵌入必须是 wmode=transpar
我有一个站点(下面的链接),其中客户的工作显示在一个长的水平页面上。菜单固定在左侧,滚动时图像会消失在菜单下方。 客户端现在已经上传了 quicktime 电影,它们不像图像那样位于菜单下,而是在菜单
我正在尝试使用 从 HTML 文档流式传输 Quicktime 文件标签。 视频格式为: Video: h264 (Main), yuv420p, 640x360, 2175 kb/s, 24 fp
目前我正在编写使用 ffmpeg 库对媒体文件进行转码的软件。问题是如果 H264 QuickTime 无法播放结果流并显示黑屏。音频流按预期工作。我读过 QuickTime 只能处理 yuv420p
有谁知道 App Store 何时开始要求在物理设备上进行应用程序预览并显示此弹出窗口? 即使我将 iPhone Xs 镜像到我的 Mac,也不会显示弹出窗口。如果视频上没有弹出窗口,应用商店将拒绝应
首先,我是 Mac 编程的新手。我已下载 macam project并使用 Xcode 4.1 成功将调试版本编译为 32 位代码。输出是我手动复制到 Library/QuickTime 文件夹的 Q
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 4年前关闭。 Improve thi
我正在尝试为一个必须执行以下操作的项目编写一个小的 AppleScript: 开始录制 QuickTime 影片 最小化录音窗口 打开一部电影,将自己置于全屏 电影播放完毕后,应停止录制 录音应将自身
我一直想知道是否可以找出用于解压缩 Quicktime 电影的编解码器(如 h.264、motion jpeg..),最好是 NSString。我搜索了 Quicktime 和 QTKit api 以
当网站首次加载时,我使用 jQuery 隐藏了大约 5 部 Quicktime 电影。我注意到,当我将网站上线时,打开网站需要 5-10 秒才能显示任何内容。有时我什至会得到一个“沙滩球”光标,就好像
我一直在寻找这个。我需要构建一个独立的实用程序,该实用程序应该: 将图像序列转换为 .mov 格式 获取用户的输入并将其显示在 mov 中。 我计划使用 Java 来完成此操作,因为这是一种跨平台语言
有没有办法获取 QuickTime 视频信息? (在谷歌搜索中,我发现了一个损坏的 QT cl 选项。) 我正在寻找 pasp、长度、音频 channel 、音频分配、拍手以及经常使用程序“Dumps
我有一个发送视频流的自定义硬件设备。 如何使该流可用于 QuickTime 应用程序? 长话短说:在 Windows 上,我创建了一个 DirectShow 过滤器,因此任何与 DirectShow
我是一名优秀的程序员,十分优秀!