Sunday, June 14, 2026
HomeAppleMy Automator Folder Action Workflow works not only works for the folder...

My Automator Folder Action Workflow works not only works for the folder designated, but also for the parent and sub folder of that folder


Today I’ve been setting up a new Folder Action automator workflow for pdf to image conversion (this is actually the first time I’m working with script and automation at all, so there may be rudimentary mistakes). The workflow works as intended: when I drop in a pdf image into the designated watch folder, the file gets converted into a png and prompts me to save it to another path. But there’s one consistent problem that I can’t solve.

The folder I use as the "Folder Action Folder" (folder name in Finder "Automated Conversion") is under another folder — call it the "Isolation Folder" (folder name in Finder "Grapher Export") — which is under the user’s Pictures folder (like below).

Pictures -> Isolation Folder -> Folder Action Folder (the folder designated in the Folder Action workflow)

Here’s a screenshot of my folder structure in Finder, hope it helps a bit:

My Automator Folder Action Workflow works not only works for the folder designated, but also for the parent and sub folder of that folder

I did this so that the "Folder Action" folder is isolated from daily activities and I won’t be accidentally adding any files to it. But I discovered that putting files in the "Isolation Folder", despite it being the parent folder of the "Folder Action Folder", still triggers the automator workflow. I am very confused that it worked like that.

Pictures -> Isolation Folder (putting file here triggers workflow, weird) -> Folder Action Folder

I did some experiments for this. In one, I added a subfolder to the "Folder Action Folder", and then added a file to that subfolder. This triggered the workflow as well.

Pictures -> Isolation Folder -> Folder Action Folder -> New Folder (putting file here also triggers workflow)

But adding files to the parent folder of the "Isolation Folder", which is the Pictures folder, doesn’t trigger any of that.

Pictures (putting file here does not trigger workflow) -> Isolation Folder -> Folder Action Folder

I tried re-creating that workflow, re-creating the folders, restarting my Mac, but the situation remained the same. Shouldn’t Folder Action workflow be only working for that one folder designated only, without getting influenced by any activities in its parent or sub folder? Does anyone have any idea on what is happening here? How should I make it that only adding files to the designated "Folder Action Folder" will trigger the workflow?

My macOS version is Sequoia 15.6.1, and here’s a screenshot of my workflow:

Screenshot of my workflow

The AppleScript I used (I combined the code from https://www.macscripter.net/t/save-files-to-a-user-chosen-location-at-runtime/71181 and Google’s search AI):

on run {input, parameters}
    
    -- Specify the text file to store the path.
    set pathFile to (alias "Macintosh HD:Users:andyzou:Pictures:Grapher Export:" as text) & ".last_folder.txt"
    
    -- Read the last saved path from the file, if it exists.
    try
        set lastPath to (read file pathFile as text)
    on error
        -- If the file does not exist, set the default path to the Desktop.
        set lastPath to path to desktop as alias
    end try
    
    set destinationFolder to (choose folder with prompt "Choose a destination folder for the Grapher Export" default location lastPath)
    
    -- Get the POSIX path of the chosen folder.
    set theChosenPath to POSIX path of destinationFolder
    
    -- Write the new path to the text file for next time.
    set fileRef to open for access file pathFile with write permission
    set eof of fileRef to 0
    write theChosenPath to fileRef
    close access fileRef
    
    tell application "Finder"
        move input to destinationFolder with replacing
    end tell
    
    tell application "Finder"
        delete (every item of folder ("Macintosh HD:Users:andyzou:Pictures:Grapher Export:Automated Conversion:"))
    end tell
    
    return input
end run
RELATED ARTICLES

Most Popular

Recent Comments