MacOS – How to find out which Automator folder actions are attached to a folder

automatorfindermacos

I spent some time experimenting with building a Folder Action for my Desktop folder. However, it seems like it's running twice.

I might have created the Folder Action more than once. How can I find out what Folder Actions I have attached to my Desktop folder? I can't see anything in Automator to list them.

Best Answer

As an alternative, this one-line snippet of AppleScript will return all folders with folder actions applied them:

tell application "System Events" to get the path of every folder action
    --> {"/Users/CK/Scripts/AppleScript/scripts", "/Users/CK/Downloads", ...}

This one might be handy too, because it lists the actual path to the scripts or Automator workflows monitoring each of your folders...

tell application "System Events" to get the POSIX path of every script of ¬
        (every folder action where class of its scripts contains script)

...or a specific folder:

tell application "System Events" to return the POSIX path of every script of ¬
        (every folder action where its path contains "/Users/CK/Desktop" and ¬
        enabled of scripts contains true)