Skip to main content
Tidy up

Sort your Downloads folder by file type on Mac

A DockRun workflow that files the loose items in Downloads into Images, Documents, Archives, Installers, Videos and Audio. Nothing is deleted.

The button needs DockRun 0.1.19 or later. On an older version, download the file, then use Settings > Restore or Import… in DockRun.

Runs in DockRun Free, which holds 2 workflows.

What it does

  • Moves each loose file into a folder for its kind: Images, Documents, Archives, Installers, Videos or Audio.
  • Leaves folders and unknown file types where they are.
  • Never overwrites: if a file with the same name is already there, the new one stays put and is listed.

What you can change

  • folder - The folder to sort. Starts as: ~/Downloads

The steps

Read the script below before you add it. It is everything this workflow runs.

  1. 1. Sort the files
    Runs this zsh script · Arguments: {{var.folder}} · Time limit: 60 seconds
    # Sorts the loose files in a folder (default ~/Downloads) into Images, Documents, Archives, Installers,
    # Videos and Audio. Folders and unknown file types stay where they are; nothing is deleted or overwritten.
    folder="${*:-~/Downloads}"; folder="${folder/#\~/$HOME}"
    [ -d "$folder" ] || { echo "No such folder: $folder" >&2; exit 1 }
    typeset -A kinds
    kinds=(
      Images     "png jpg jpeg gif heic webp svg tiff bmp"
      Documents  "pdf doc docx xls xlsx ppt pptx txt md rtf csv pages numbers key epub"
      Archives   "zip rar 7z tar gz tgz bz2 xz"
      Installers "dmg pkg"
      Videos     "mp4 mov mkv avi webm m4v"
      Audio      "mp3 wav m4a flac aac ogg"
    )
    moved=0
    for file in "$folder"/*(N.); do
      ext="${(L)file:e}"; [ -n "$ext" ] || continue
      for kind in ${(k)kinds}; do
        if [[ " ${kinds[$kind]} " == *" $ext "* ]]; then
          mkdir -p "$folder/$kind"
          if [ -e "$folder/$kind/${file:t}" ]; then echo "Kept ${file:t} (a file with that name is already in $kind)"
          else mv -n "$file" "$folder/$kind/" && moved=$((moved + 1)); fi
          break
        fi
      done
    done
    echo "Sorted $moved files in $folder"
    

After you add it

  1. DockRun shows what is in the file and asks before adding it. The workflow arrives turned off.
  2. Open it, read the steps, then turn on the On switch.
  3. Press Run. DockRun asks before a script runs; tick "Don't ask again for this exact step" once you trust it.

Good to know

Works on any folder: change the folder variable to sort your Desktop instead.

Last tested: 2026-11-12 · All workflows →

Curious if DockRun is right for you?

Let ChatGPT, Claude, or Perplexity look into it - click below and see what AI actually thinks about DockRun.

Sort your Downloads folder by file type on Mac | DockRun