5

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.

3 Answers 3

6

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.

1
  • 2
    This app is in CoreServices; open with open -a "Folder Actions Setup" or at '/System/Library/CoreServices/Applications/Folder Actions Setup.app' (macOS 13 Ventura)
    – mrgnw
    Commented Apr 11, 2023 at 13:45
5

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)
2
  • That is handy — it took me ages to have any idea where the workflow files are actually saved. (Usually ~/Library/Workflows, right?) Commented Jun 7, 2019 at 8:25
  • 1
    For folder actions, usually ~/Library/Services (on High Sierra, at least).
    – CJK
    Commented Jun 7, 2019 at 8:29
2

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
3
  • Could you explain where I run this code? When I paste to Script Editor and compile, it errors "Error on line 1: SyntaxError: Unexpected identifier 'application'. OS Catalina Thanks for helping this frustrated noob.
    – BStone
    Commented Aug 30, 2021 at 16:42
  • I'm guessing that it means the code won't work on OS Catalina . It worked for me on macOS Mojave and Big Sur
    – wch1zpink
    Commented Aug 30, 2021 at 17:04
  • Ha, six months later I've run into this script and my own prior question. If I add this script to an Automator "Run Applescript" it compiles OK, but has no output. Could you explain where I run this code, and where the results are reported? Thx.
    – BStone
    Commented Mar 10, 2022 at 23:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .