Skip to content

iOS, macOS, web, and science. Hacked.

  • Articles
  • About
  • Colophon

Search

Folder Actions in iCloud

February 18, 2026 Updated February 23, 2026 3 min read macOS

Using Folder Actions on macOS to Move Files into iCloud Drive

Folder Actions on macOS allow you to attach small AppleScript workflows to a folder so that when files appear, macOS automatically performs an action. In this case, the action will move any new file from a watched folder to a target folder inside iCloud Drive.

Sure, there are native Mac apps that will do this for you, like Hazel (which I use), but if you have a limited use case to invest in a third‑party app, Folder Actions can be a great solution.

This guide uses clear, direct steps and focuses entirely on the built‑in tools provided by macOS. The steps below have been verified on macOS Tahoe.


Step 1: Create or Identify the Source Folder

Choose the folder on your Mac that will trigger the action. This might be ~/Downloads, a project folder, or a custom folder you create.

You do not need to enable anything yet. Just decide which folder you want macOS to watch.


Step 2: Locate the iCloud Drive Destination Folder

Open iCloud Drive in Finder. Create or choose the folder that will receive incoming files. For example:

~/Library/Mobile Documents/com~apple~CloudDocs/Inbox

This path is the actual filesystem location of iCloud Drive. macOS will automatically sync anything placed there.


Step 3: Open Folder Actions Setup

  1. Open Finder.
  2. Control‑click the source folder.
  3. Choose Services → Folder Actions Setup.
    If macOS asks whether you want to enable Folder Actions, choose Enable.

A small utility will appear that allows you to attach an action script from a list of available scripts.


Step 4: Write the Folder Action Script

Open Script Editor from Applications → Utilities, or use osacompile from the Terminal.

Paste the following AppleScript:

on adding folder items to this_folder after receiving added_items
    set destinationFolder to POSIX file "/Users/USERNAME/Library/Mobile Documents/com~apple~CloudDocs/Inbox" as alias

    repeat with anItem in added_items
        try
            tell application "Finder"
                move anItem to destinationFolder
            end tell
        end try
    end repeat
end adding folder items to

Replace USERNAME with your actual short username on the Mac.

This script tells macOS that every time a file lands in the source folder, Finder should move it into your iCloud Drive folder.

To compile from the Terminal instead of Script Editor, run:

osacompile -o ~/Library/Scripts/Folder\ Action\ Scripts/MoveToiCloud.scpt MoveToiCloud.applescript

Step 5: Save the Script to the Folder Action Scripts Directory

Save the compiled .scpt file to:

~/Library/Scripts/Folder Action Scripts/

If this directory does not exist, create it. This is the location macOS reads when presenting the list of available Folder Action scripts.


Step 6: Attach the Script to the Folder

  1. Return to the Folder Actions Setup window from Step 3.
  2. Select the source folder in the list.
  3. Click + to add a new script.
  4. Your saved script will now appear in the list of available scripts. Select it and confirm.

Step 7: Test the Automation

Drop a test file into the watched folder.
After a moment, it should disappear and reappear inside the iCloud Drive folder.
You may see a short delay as Finder processes the move.


Step 8: Confirm iCloud Sync

iCloud Drive should sync automatically.
Open the Files app on an iPhone or iPad or another Mac to confirm that the file appears there.


Optional Notes

You can attach multiple Folder Actions to the same folder.
If you want more advanced logic such as renaming or filtering by file type, you can extend the AppleScript with conditional rules.

Written by Michael Henry

Post navigation

Previous: AdGuard Home Tailscale Troubleshooting Guide
Next: Running Jupyter Notebooks With uv
Michael Henry

Michael Henry

© 2026 Digital Javelina, LLC