Rico009
V2EX  ›  macOS

用 Automator 如何做到对文件夹的自动监控

  •  
  •   Rico009 · Aug 6, 2016 · 3418 views
    This topic created in 3578 days ago, the information mentioned may be changed or developed.

    之前在 Automator 里建了一个 folder action ,理论上可以自动对 downloads 文件夹里新添加的压缩包自动解压缩,在 Automator 里运行也是没问题的。 之后移动到 /Users/xxx/Library/Workflows/Applications/Folder Actions/ 的文件夹里,却无法做到自动监控,所以是哪里出了问题吗

    Supplement 1  ·  Aug 6, 2016
    workflow 是这样的
    11 replies    2016-08-08 21:31:27 +08:00
    kkxxxxxxx
        1
    kkxxxxxxx  
       Aug 6, 2016
    权限?
    Rico009
        2
    Rico009  
    OP
       Aug 6, 2016
    @kkxxxxxxx 呃能具体说下是哪里的权限吗😳
    Sylv
        3
    Sylv  
       Aug 6, 2016 via iPhone
    这种需求建议用 Hazel ,会比较容易实现
    https://www.noodlesoft.com
    fatestigma
        4
    fatestigma  
       Aug 6, 2016
    在 Automator 里能正常运行那就是有问题的吧, Automator 在运行 Folder Action 的时候会提示使用 Automator 测试需要使用 Get Specified Finder Items 来做调试,而最后保存的时候应该去掉这个测试 Action 改为例如 Filter Finder Items 之类。最好你可以把你的 Workflow 贴出来看看有没有问题。

    我测试了一下,我这里是没有问题的。
    Rico009
        5
    Rico009  
    OP
       Aug 6, 2016
    @fatestigma 嗯我的意思就是 Get Specified Finder Items 后测试没问题,具体贴在了附言里,感谢
    Rico009
        6
    Rico009  
    OP
       Aug 6, 2016
    @Sylv 太贵了,只为了这个不值得...
    zander
        7
    zander  
       Aug 6, 2016 via iPhone
    hammerspoon , maid ,功能类似,免费。
    geeti
        8
    geeti  
       Aug 7, 2016
    launchctl 可以监控文件夹,我觉得比 automator 好用
    idigital
        9
    idigital  
       Aug 7, 2016 via iPhone
    文件夹上右键-文件夹操作-里面有监视文件夹的 AppleScript 实例
    RqPS6rhmP3Nyn3Tm
        10
    RqPS6rhmP3Nyn3Tm  
       Aug 7, 2016 via iPhone
    用 pyinotify 多好
    Rico009
        11
    Rico009  
    OP
       Aug 8, 2016
    @idigital 感谢,解决问题了🙏
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   937 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 57ms · UTC 19:09 · PVG 03:09 · LAX 12:09 · JFK 15:09
    ♥ Do have faith in what you're doing.