【问题标题】:Automator find array of names in find finder itemsAutomator 在查找查找器项目中查找名称数组
【发布时间】:2016-12-19 16:56:17
【问题描述】:

您好,我正在尝试在 automator 中查找一堆名称不同的文件。

我已设置查找查找器项目以查找包含“房间”的名称

这只会选择 1 个文件。

问题是我有一个特定名称的列表,而不是添加许多条件并分别粘贴每个名称,我想知道是否有一种方法可以创建一个数组并列出所有名称?

我尝试添加一个逗号来分隔每个名称,但它会将其读取为一个大字符串。

谢谢!

【问题讨论】:

  • 如果要过滤名称列表中的部分字符串,则需要重复循环。

标签: applescript automator finder


【解决方案1】:

我制作了一个 Applescript,您可以在 Find Finder Items 操作之后添加它,该脚本将返回找到的文件路径列表:

on run {input, parameters}
    set noFilesInputed to the number of items of input
    set fileList to {}
    if noFilesInputed is greater than 0 then
        repeat with cFile from 1 to noFilesInputed
            set cFileItem to item cFile of input
            set cFilePath to cFileItem as string
            set fileList to fileList & {cFilePath}
        end repeat
    end if
    return fileList
end run

如果输入的项目数为0,那么 输出的列表为空

希望这会有所帮助!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-28
    • 1970-01-01
    • 2013-04-20
    • 2020-06-05
    相关资源
    最近更新 更多