Apple - How can I find out which Automator folder actions are attached to a folder?

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)

Open the Folder Actions Setup app. This lists folders with actions, and the actions that each folder has assigned to it.

You can add and remove actions from folders here, and enable/disable folder actions globally.


Here is another option you may find useful.

This AppleScript code works for me using the latest version of macOS Mojave.

tell application "Folder Actions Setup"
    activate
    set everyFolderAction to a reference to every folder action
    set folderNamesWithAttachedFolderActions to name of everyFolderAction
    set pathToFoldersWithAttachedFolderActions to path of everyFolderAction

    if "Desktop" is in folderNamesWithAttachedFolderActions then
        tell folder action "Desktop"
            set scriptsAttachedToDesktop to ({name, path} of scripts)
        end tell
    end if

    quit
end tell