Applescript / 脚本桥中的 QuickTimeX
我希望能够使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您下载 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.
可以使用 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.