我正在尝试编写在 Wirecast 中打开媒体文件的脚本。我想将特定文件夹中的所有文件作为 Wirecast“镜头”打开。
根据 Wirecast Dictionary,添加镜头的 applescript 命令语法为:
AddShotWithMedia层与 posix_path任何东西
我不知道如何获取文件夹中所有文件的 posix 路径列表,或者将 applescript 路径转换为 Wirecast 可接受的 posix 路径。
这是代码:
tell application "Finder"
set SettingsFolder to folder "WirecastMedia" of home
set MediaFolder to folder "Titles" of SettingsFolder
set TitleList to entire contents of MediaFolder
end tell
tell application "Wirecast"
activate
set myFile to (file "KorgWirecast.wcst" of SettingsFolder)
open myFile as alias
set myDoc to last document
set myLayer to the layer named "Titles" of myDoc
repeat with aFile in TitleList
AddShotWithMedia myLayer with posix_path aFile
end repeat
end tell
...它在AddShotWithMedia行上失败并显示以下消息:
Can’t make «class docf» "ManyVoicesSuper.png" of «class cfol» "Titles"
of «class cfol» "WirecastMedia" of «class cfol» "ram" of «class cfol»
"Users" of «class sdsk» of application "Finder" into the expected type.