Skip to content

MacStenk/macos-workspace-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

macOS Workspace Automation πŸš€

Automatically start and position your apps on macOS with a single click - perfect for dual monitor setups!

License: MIT macOS AppleScript


🎯 Problem

Every morning, you manually:

  • Open 5+ applications
  • Drag each window to the correct position
  • Resize them to the perfect size
  • Waste 5-10 minutes doing the same repetitive task

There has to be a better way!

πŸ’‘ Solution

A simple AppleScript that:

  • βœ… Starts all your apps automatically
  • βœ… Positions every window exactly where you want it
  • βœ… Works with dual/triple monitor setups
  • βœ… Requires zero additional software (native macOS only!)
  • βœ… Takes 30 seconds to set up
  • βœ… Saves you 30+ hours per year

✨ Features

  • πŸš€ One-Click Startup - Double-click to launch your entire workspace
  • πŸ–₯️ Perfect Positioning - Every window in its exact place, every time
  • βš™οΈ Easy Customization - Simple copy & paste to add new apps
  • πŸ’― Zero Dependencies - Uses only built-in macOS features
  • πŸ”’ Privacy-First - Everything runs locally, no cloud services
  • πŸ“ Well Documented - Complete guide included (German & English)

πŸš€ Quick Start

πŸ“Ί Video Tutorial Coming Soon! I'm creating a complete video walkthrough. Subscribe to the newsletter for updates!

1. Read Current Window Positions

  1. Open Script Editor (Applications β†’ Utilities β†’ Script Editor)
  2. Copy the content of scripts/read-window-positions.scpt
  3. Paste and click Run β–Ά
  4. Copy the output from the "Result" window

2. Create Your Workspace Script

  1. Copy scripts/launch-workspace.scpt as a template
  2. Replace the app names and positions with your values from step 1
  3. Save as Application (File β†’ Save, Format: "Application")
  4. Done! Double-click to launch your workspace

3. Optional: Auto-Start on Login

  1. System Preferences β†’ General β†’ Login Items
  2. Click + and add your saved app
  3. Your workspace now starts automatically at login!

πŸ“– Documentation

πŸ“ Repository Structure

macos-workspace-automation/
β”œβ”€β”€ README.md                          # Quick start guide (English)
β”œβ”€β”€ DOCUMENTATION.md                   # Detailed guide (German)
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ read-window-positions.scpt     # Script to read current positions
β”‚   └── launch-workspace.scpt          # Main workspace launcher script
β”œβ”€β”€ examples/
β”‚   └── example-workspace.scpt         # Example configuration
β”œβ”€β”€ LICENSE                            # MIT License
└── .gitignore                         # Git ignore file

πŸ› οΈ How It Works

Step 1: Read Window Positions

The read-window-positions.scpt script scans all open windows and outputs:

App: Visual Studio Code (1 Window)
Window 1: My Project
  Position: x=0, y=23
  Size: 1920 x 1057

Step 2: Launch & Position

The launch-workspace.scpt script:

-- Start apps
tell application "Visual Studio Code" to activate
delay 1

-- Position windows
tell application "System Events"
    tell process "Electron"
        set position of window 1 to {0, 23}
        set size of window 1 to {1920, 1057}
    end tell
end tell

πŸ’» Example Configuration

This example workspace includes:

  • Visual Studio Code - Main editor on left monitor
  • Browser (Comet) - Documentation on right monitor
  • Notes - Top right for quick reference
  • Docker Desktop - Bottom right for monitoring
  • Finder - File browser on second monitor

Result: Perfect workspace in 3 seconds! ⚑

πŸ”§ Customization

Adding a New App

  1. Open the app and position it where you want it

  2. Run read-window-positions.scpt

  3. Find your app in the output:

    App: Activity Monitor (1 Window)
      Position: x=2100, y=800
      Size: 900 x 600
    
  4. Add to your workspace script:

    tell application "Activity Monitor" to activate
    delay 0.5
    
    tell application "System Events"
        tell process "Activity Monitor"
            set position of window 1 to {2100, 800}
            set size of window 1 to {900, 600}
        end tell
    end tell

Important Notes

  • Process names are often in English, even if your system language is German
    • German: "AktivitΓ€tsanzeige" β†’ Process: "Activity Monitor"
    • German: "Systemeinstellungen" β†’ Process: "System Settings"
  • Electron apps (VS Code, Slack, Discord, etc.) have the process name "Electron"
  • Add longer delay for heavy apps (e.g., Docker Desktop needs 2 seconds)

πŸŽ“ Use Cases

Perfect for:

  • πŸ’» Developers - Instant coding environment
  • ⚑ Power Users - Maximum productivity
  • 🎯 Content Creators - Organized creative workspace
  • πŸ–₯️ Dual Monitor Users - Perfect window management
  • 🏒 Remote Workers - Consistent workspace anywhere
  • πŸ“Š Data Analysts - All tools in the right place

🌟 Why This Solution?

vs. Commercial Tools

Feature This Script Moom Rectangle Pro BetterSnapTool
Price Free $10 $10 $3
Customization Unlimited Limited Limited Limited
No Dependencies βœ… ❌ ❌ ❌
Version Control βœ… ❌ ❌ ❌
Learning Experience βœ… ❌ ❌ ❌

Advantages

  • βœ… 100% Free - No subscriptions or licenses
  • βœ… Fully Customizable - Every detail under your control
  • βœ… Educational - Learn AppleScript and automation
  • βœ… Portable - Works on any Mac
  • βœ… Transparent - You see exactly what happens
  • βœ… Future-Proof - No dependency on third-party updates

πŸ”’ Privacy & Security

  • All processing is local - No data leaves your Mac
  • No network access - Works completely offline
  • Open source - Review the code yourself
  • No tracking - Zero analytics or telemetry
  • System Events permission required - Standard macOS accessibility feature

⚠️ Requirements

  • macOS 10.15 (Catalina) or newer
  • Accessibility permission for Script Editor
    • System Preferences β†’ Privacy & Security β†’ Accessibility
    • Enable "Script Editor"

🀝 Contributing

Contributions are welcome! Feel free to:

  • πŸ› Report bugs
  • πŸ’‘ Suggest features
  • πŸ“ Improve documentation
  • πŸ”€ Submit pull requests

πŸ“ License

MIT License - see LICENSE file for details.

πŸ‘€ Author

Steven Noack

πŸ™ Acknowledgments

  • Inspired by the need for a simple, free workspace automation solution
  • Built with native macOS technologies
  • Thanks to the AppleScript community

πŸ“š Further Reading


Made with ❀️ for productivity enthusiasts

Star ⭐ this repo if it saved you time!