constantworkflow

quit-production-apps

Quit Production Apps: End-of-Day Cleanup Without Closing Your Entire Workspace

When it's 5 PM and time to close the laptop, I don't want to manually hunt through running apps to quit DaVinci Resolve, After Effects, Blender, and Media Encoder while carefully preserving Obsidian, Messages, my browser, and other personal tools. This script automates the end-of-day ritual by closing only production apps, leaving my personal workspace intact for when I open the laptop at home.

The Problem

I used to rely on Raycast's built-in "Quit All Apps" command to clean up at the end of the workday. It worked well—one keystroke, everything closed, laptop lid shut, done.

But I rely on certain apps staying open across work/home contexts:

These apps take time to boot, restore state, and reload tabs. I don't want to wait 10-20 seconds for my browser to reopen 30 tabs or Obsidian to reload my vault every time I open my laptop at home. But more importantly, I don't want to lose context. My browser has research tabs open, Obsidian has my daily note in progress, Messages has active conversations.

"Quit All Apps" was too broad. It closed everything, including my personal workspace. The alternative—manually quitting each production app individually—was tedious and error-prone.

I also hide my macOS dock, so I never see which apps are running. I just know. This is a focus optimization—the dock's app indicators are visual noise I don't need. But it means I can't easily glance at the dock to see if After Effects is still running from a client project I worked on earlier that morning.

The result: I'd get home, open my laptop, and realize "oh, After Effects was still open, that sucks." My laptop's battery had drained, fans had been spinning for hours, and a 4GB app was consuming RAM I didn't need to reserve.

The Solution

This script closes only production apps—DaVinci Resolve, Fusion, Blender, Adobe Creative Suite—while leaving personal tools untouched. The workflow is now:

  1. 5 PM hits, workday is done
  2. Cmd+Space to open Raycast
  3. Type "quit production," hit Enter
  4. Script closes all work apps, prompts to save unsaved projects
  5. Close laptop lid with confidence—work is done, personal apps are intact

Total time: 2 seconds. And I know for certain that production apps are closed and saved, even if I can't see the dock.

Technical Implementation

The script uses two different quit strategies depending on app naming conventions:

1. Exact Name Matching for Stable Apps

For apps with consistent names across versions (DaVinci Resolve, Fusion, Blender), the script uses pgrep to check if the process is running and killall to quit it:

apps=(
    "DaVinci Resolve"
    "DaVinci Resolve Studio"
    "Resolve"
    "Fusion"
    "Fusion Studio"
    "Blender"
)

for app in "${apps[@]}"; do
    if pgrep -x "$app" > /dev/null; then
        killall "$app" 2>/dev/null
        echo "Quit $app"
    fi
done

pgrep -x performs an exact match on the process name. This prevents false positives (e.g., matching "Resolve Helper" when searching for "Resolve"). If the process is found, killall sends a graceful quit signal (SIGTERM), not a force kill (SIGKILL).

2. Pattern Matching for Adobe Apps (The Annoyance Tax)

Adobe apps have an infuriating naming convention: they append the year to the app name every update. "Adobe Premiere Pro 2024" becomes "Adobe Premiere Pro 2025" after an upgrade. This breaks exact name matching—you'd have to update the script every year.

The solution: pattern matching with pkill -f:

adobe_apps=("Adobe Premiere Pro" "Adobe After Effects" "Adobe Media Encoder" "Adobe Photoshop")

for app in "${adobe_apps[@]}"; do
    pkill -f "$app" 2>/dev/null && echo "Quit $app"
done

pkill -f matches against the full command line, not just the process name. This means "Adobe Premiere Pro" matches both "Adobe Premiere Pro 2024" and "Adobe Premiere Pro 2025" without modification. When Adobe releases a 2026 version, the script still works.

This is a classic example of defensive scripting—accounting for vendor inconsistencies so the automation doesn't break with routine updates.

3. Graceful Quit, Not Force Kill

The script sends SIGTERM (graceful quit signal) to processes, not SIGKILL (force kill). This means:

I click "Save," the app closes, and work is preserved. This is critical for an end-of-day cleanup script—I don't want to lose work because I forgot to save before triggering the automation.

The downside: if an app is frozen or unresponsive, it won't quit. In those rare cases, I manually force quit via Activity Monitor or kill -9. But 99% of the time, graceful quit is the right default.

Use Cases

Primary: End-of-Day Workday Cleanup

At 5 PM, I trigger this script to close all production apps before leaving the office. This ensures:

I close the laptop lid knowing work is completely saved and finished.

Secondary: "Did I Forget to Close That?"

Because I hide my dock, I can't see which apps are running without Cmd+Tabbing through everything. If I worked on an After Effects project at 10 AM but spent the rest of the day in DaVinci Resolve, I might forget After Effects is still open.

When I get home and open my laptop, I see After Effects in the Cmd+Tab switcher and think "oh, that sucks." This script prevents that. I run it at the end of the workday, and I know for certain that all production apps are closed—no surprises later.

Future Use Case: SD Card/Lavalier Disconnect Automation

I'm considering adding SD card unmounting and USB audio device disconnection to this script. Currently, I do media dumps as a separate process (not at end of day), but integrating it here would streamline the "close laptop and leave" workflow.

The script could:

  1. Quit production apps
  2. Unmount external drives (SD cards, SSDs)
  3. Safely disconnect USB audio interfaces (lavalier receivers, Scarlett interfaces)
  4. Display a notification when everything is ready to unplug

This would eliminate the "oh, I didn't eject that drive" panic when unplugging devices.

Time Savings

Manual process: Cmd+Tab through running apps (6-8 production apps), Cmd+Q each one individually, confirm save dialogs. Estimated time: 20-30 seconds depending on how many apps are open and how many require saving.

Automated process: 2 seconds (Raycast trigger → automatic quit sequence → save prompts).

Savings per use: 18-28 seconds.

I use this script daily at the end of the workday (5 PM). At 5 days per week, this saves 90-140 seconds (1.5-2.3 minutes) weekly.

But the real value is peace of mind. I don't have to remember which apps are open or hunt through the Cmd+Tab switcher to ensure everything is closed. The script handles it, and I can close my laptop with confidence.

Why Not Just Use Raycast's "Quit All Apps"?

Raycast's built-in "Quit All Apps" command is excellent for full system cleanup, but it's too broad for my workflow. It closes:

These apps take 10-20 seconds to reboot and restore state. More importantly, I lose context. My browser has to reload tabs, Obsidian has to reopen my vault, Messages has to reconnect.

By closing only production apps, I preserve my personal workspace while ensuring work-related tools (heavy, battery-draining apps like DaVinci Resolve and After Effects) are shut down.

This script is a context boundary—it separates work and personal app ecosystems so I can cleanly close one without disrupting the other.

Implementation Notes

This script requires:

Customizing the App List

To add or remove apps, edit the apps array (lines 17-24) or adobe_apps array (lines 35):

apps=(
    "DaVinci Resolve"
    "Final Cut Pro"        # Add other production apps
    "Logic Pro"
    "Blender"
)

adobe_apps=("Adobe Premiere Pro" "Adobe After Effects" "Adobe Illustrator")

Exact name matching: Use the apps array for apps with stable names.

Pattern matching: Use the adobe_apps array for apps with year-based versioning (Adobe apps, Autodesk apps, etc.).

Testing Without Closing Apps

To see which apps would be closed without actually quitting them, replace killall and pkill with echo:

# Test mode - shows what would be quit
if pgrep -x "$app" > /dev/null; then
    echo "Would quit: $app"
fi

Run the script, verify the output, then restore the killall and pkill commands.

Hidden Dock Users

If you hide your dock like I do (System Settings → Desktop & Dock → Automatically hide and show the Dock), this script is especially valuable. You can't see which apps are running without Cmd+Tabbing through them, so a one-command cleanup ensures nothing is left open unintentionally.

Why This Matters

This script doesn't just save 20 seconds at the end of the day—it removes decision fatigue and surprise battery drain. When it's 5 PM and I'm ready to leave, I don't want to think about which apps need closing. I trigger the script, save any unsaved work, and close the laptop.

The work/personal context separation is critical. I don't want to lose my browser tabs, Obsidian notes, or Messages conversations just to ensure DaVinci Resolve is closed. By targeting only production apps, the script preserves what matters while cleaning up what doesn't.

For anyone working in video production, motion graphics, or VFX—where heavyweight apps like DaVinci Resolve, After Effects, and Blender consume gigabytes of RAM and drain battery when idle—this automation pays for itself the first time you avoid leaving After Effects running overnight.

The Adobe pattern-matching approach is a bonus lesson in defensive scripting: account for vendor quirks (yearly app versioning) so your automation doesn't break with routine updates. When Adobe releases Premiere Pro 2026, the script will still work without modification.