Applescript:获取文件夹中所有文件的POSIX路径

Applescript:获取文件夹中所有文件的POSIX路径,applescript,posix,Applescript,Posix,我正在尝试用Wirecast编写打开媒体文件的脚本。 我想以有线广播“快照”的形式打开特定文件夹中的所有文件 根据Wirecast字典,添加快照的applescript命令语法为: 添加带有posix_路径的媒体层的快照 我不知道如何获取文件夹中所有文件的posix路径列表,或者将applescript路径转换为Wirecast可接受的posix路径 代码如下: tell application "Finder" set SettingsFolder to folder "Wirecas

我正在尝试用Wirecast编写打开媒体文件的脚本。 我想以有线广播“快照”的形式打开特定文件夹中的所有文件

根据Wirecast字典,添加快照的applescript命令语法为:

添加带有posix_路径的媒体层的快照

我不知道如何获取文件夹中所有文件的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.
文件“manyvoicesuper.png”,文件夹“Titles”…应用程序“Finder”“
是文件的查找器引用。您需要的是POSIX路径形式的字符串。我注意到您正在使用文件夹的全部内容,其中包括子文件夹,但如果您只需要从顶部文件夹中取出文件,则可以使用如下系统事件:

tell application "System Events"
    set TitleList to POSIX path of disk items of folder "~/WirecastMedia/Titles"
end tell

完美的非常感谢。我花了我所有的时间试图强迫路径从一种形式到另一种形式。奇怪的是,在一个大的脚本中必须携带两种不同的路径格式。您可能认为有一种标准的方法来强制使用路径格式。