Applescript / 脚本桥中的 QuickTimeX

发布于 2024-09-01 12:22:00 字数 420 浏览 7 评论 0原文

我希望能够使用 ScriptingBridge 和 Ruby 获取 Quicktime X 中当前播放文件的元数据,到目前为止我有以下代码

require 'osx/cocoa'
OSX.require_framework 'ScriptingBridge'

@app = OSX::SBApplication.applicationWithBundleIdentifier("com.apple.QuickTimePlayerX")

@app.documents.each do |movie|
  # What now?!
end

但是我在 QuickTime X 的 applescript 字典中找不到任何函数来从document 对象(与您在 QT 的“显示电影检查器”HUD 中看到的数据相同)——有人有什么想法吗?

I'd like to be able to grab the metadata of the currently playing file in Quicktime X using ScriptingBridge and Ruby, so far I have the following code

require 'osx/cocoa'
OSX.require_framework 'ScriptingBridge'

@app = OSX::SBApplication.applicationWithBundleIdentifier("com.apple.QuickTimePlayerX")

@app.documents.each do |movie|
  # What now?!
end

But I can't find any functions in QuickTime X's applescript dictionary to get the metadata from a document object (the same data you can see in QT's 'Show Movie Inspector' HUD) — does anyone have any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

秋心╮凉 2024-09-08 12:22:00

如果您下载 QuickTime Player 7 并使用它会怎么样?它不会取代 QuickTime Player X,并且具有许多 X 没有的功能(尽管您需要专业序列号才能从 GUI 访问某些功能)。 Apple 仍然提供此版本是有充分理由的!

或者,如果您已经编写了一些 Obj-C 代码,您可以更进一步,直接访问元数据,如图所示 此处

What about if you download QuickTime Player 7 and use that instead? It wont replace QuickTime Player X and has many features that X does not (although you'll need a pro serial number to access some of the features from the GUI). Apple still make this version available for a good reason!

Alternatively, if you've got as far as writing some Obj-C code, you could go one step further and access the metadata directly, as illustrated here.

猫腻 2024-09-08 12:22:00

可以使用 Looksee gem 来快速检查对象 - 告诉您 ruby​​ 上可用的方法-目的。我不知道它是否能与 ScriptingBridge 一起正常工作,但尝试起来很快。

A quick inspection of objects can be done with the Looksee gem - tells you what methods are available on a ruby-object. I don't know if it will work properly with ScriptingBridge, but it's quick to try.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文