【问题标题】:Mac Automator: Mass-create SubfoldersMac Automator:批量创建子文件夹
【发布时间】:2025-05-25 19:05:01
【问题描述】:

我正在尝试使用 Automator 获取一堆先前创建的文件夹,并在每个文件夹中创建两个新文件夹,一个“Originals”文件夹和一个“Scans”文件夹。我希望能够拖动或选择需要子文件夹的文件夹,然后自动运行操作。

我已尝试同时进行操作和服务来添加子文件夹,但是当我选择多个文件夹时,它只运行一次。

这是我到目前为止所做的屏幕截图...

【问题讨论】:

    标签: macos automator subdirectory


    【解决方案1】:

    尝试将工作流保存为应用程序:

    将应用程序保存到您的桌面,然后您可以随时将文件夹放在那里。

    这是一个 AppleScript,当它作为应用程序导出时,它作为一个 Droplet 用于在其上放置的每个文件夹中创建所需的文件夹:

    on open droppings
        repeat with everyDrop in droppings
            if (info for everyDrop)'s folder is true then
                --make two folders
                tell application "Finder"
                    make new folder at (everyDrop as text) with properties {name:"Originals"}
                    make new folder at (everyDrop as text) with properties {name:"Scans"}
                end tell
            end if
        end repeat
    end open
    
    on run
        display dialog "Drop some folders here to add Originals and Scans folders" buttons {"Aye Aye"} default button "Aye Aye"
    end run
    

    【讨论】:

    • 我将它保存为应用程序,但我仍然遇到同样的问题。我将 3 个空的测试文件夹拖到应用程序中,但“Originals”和“Scans”文件夹仅在 3 个文件夹中的 1 个文件夹中创建...
    • 这太疯狂了。您的工作流程看起来不错。我会用它做实验看看。自您发布原始帖子以来,您是否对工作流程进行了任何更改?
    • 真气。我也不能让它工作。但是,我没有花我的周末时间来解决这个问题,而是编写了一个 AppleScript 来完成这项工作。我希望它对你有用。