# macOS Common Operations Guide

This guide provides key steps for common desktop operations on macOS using Computer Use tools. Each operation describes the concept and critical steps — use screenshots to determine exact coordinates and UI element positions.

---

## 1. App Management

### Launch an App via Spotlight
- Press `Cmd+Space` to open Spotlight
- Type the app name (e.g., "Safari", "Visual Studio Code")
- Press `Enter` to launch the top result
- Wait 1-2 seconds for the app to open, then screenshot to confirm

### Launch an App from Dock
- The Dock is typically at the bottom of the screen
- Screenshot to identify the app icon position in the Dock
- Click on the target app icon

### Switch Between Apps
- Press `Cmd+Tab` to show the app switcher overlay
- Continue holding `Cmd` and press `Tab` to cycle through apps
- Release `Cmd` to switch to the highlighted app
- Alternatively, click on the target app icon in the Dock

### Quit an App
- Press `Cmd+Q` to quit the current foreground app
- This closes all windows of the app

### Force Quit an Unresponsive App
- Press `Cmd+Option+Esc` to open the Force Quit dialog
- Screenshot to identify the hung app in the list
- Click on the app name, then click "Force Quit"

---

## 2. Window Management

### Minimize / Close a Window
- **Minimize**: Press `Cmd+M` (window goes to Dock)
- **Close**: Press `Cmd+W` (closes the window, app may stay running)
- The traffic light buttons (red/yellow/green) are at the top-left corner of windows

### Full Screen Toggle
- Press `Ctrl+Cmd+F` to toggle full screen mode
- Or click the green button at the top-left of the window
- Press `Esc` or `Ctrl+Cmd+F` again to exit full screen

### Split Screen (Side by Side)
- Hover over the green button at the top-left of a window until a dropdown appears
- Select "Tile Window to Left/Right of Screen"
- Then select a second window to fill the other half
- Note: This only works for apps that are not already in full screen

### Mission Control
- Press `Ctrl+Up` (or `F3` on some keyboards) to show all windows and desktops
- Click on a window to bring it to focus
- Press `Ctrl+Up` again or click on the desktop to exit

### Switch Between Desktops
- Press `Ctrl+Left` or `Ctrl+Right` to move between virtual desktops (Spaces)
- In Mission Control, click on desktop thumbnails at the top to switch

---

## 3. File Operations

### Open Finder
- Click the Finder icon in the Dock (smiley face icon, usually the leftmost)
- Or press `Cmd+Space`, type "Finder", and press `Enter`

### Navigate to Common Locations
- **Home directory**: `Cmd+Shift+H`
- **Desktop**: `Cmd+Shift+D`
- **Downloads**: `Cmd+Shift+L` (or `Option+Cmd+L`)
- **Applications**: `Cmd+Shift+A`
- **Go to specific path**: `Cmd+Shift+G` then type the path (e.g., `/usr/local/bin`)

### File Operations
- **Copy**: Select file(s) then `Cmd+C`
- **Paste**: Navigate to destination then `Cmd+V`
- **Move** (cut & paste): `Cmd+C` then `Cmd+Option+V` at destination
- **Delete**: Select file(s) then `Cmd+Delete` (moves to Trash)
- **Rename**: Select file, press `Enter`, type new name, press `Enter` again
- **New Folder**: `Cmd+Shift+N`
- **Duplicate**: `Cmd+D`

### Quick Look Preview
- Select a file and press `Space` to preview without opening
- Press `Space` again to close the preview

### Search in Finder
- Press `Cmd+F` while in Finder to search
- Type the search term and press `Enter`

---

## 4. System Settings

### Open System Settings
- Click the Apple menu () at the top-left of the screen, then select "System Settings"
- Or press `Cmd+Space`, type "System Settings", and press `Enter`

### Navigate to Common Settings Modules
Once System Settings is open, the left sidebar contains all categories. Click on the target category:

| Setting | Navigation Path |
|---------|----------------|
| WiFi | System Settings > Wi-Fi |
| Bluetooth | System Settings > Bluetooth |
| Display | System Settings > Displays |
| Sound | System Settings > Sound |
| Notifications | System Settings > Notifications |
| Keyboard | System Settings > Keyboard |
| Trackpad | System Settings > Trackpad |
| Network | System Settings > Network |
| Privacy & Security | System Settings > Privacy & Security |
| Appearance (Light/Dark) | System Settings > Appearance |

- Use the search field at the top of System Settings to quickly find a setting
- Screenshot after navigating to confirm you're in the right section

---

## 5. Text Editing (Universal)

### Basic Operations
- **Copy**: `Cmd+C`
- **Paste**: `Cmd+V`
- **Cut**: `Cmd+X`
- **Undo**: `Cmd+Z`
- **Redo**: `Cmd+Shift+Z`
- **Select All**: `Cmd+A`

### Text Selection
- **Select character by character**: `Shift+Left/Right`
- **Select word by word**: `Option+Shift+Left/Right`
- **Select to start/end of line**: `Cmd+Shift+Left/Right`
- **Select to start/end of document**: `Cmd+Shift+Up/Down`
- **Select a line**: Click at line start, then `Shift+Down` or `Shift+End`

### Navigation
- **Jump to start/end of line**: `Cmd+Left/Right`
- **Jump word by word**: `Option+Left/Right`
- **Jump to start/end of document**: `Cmd+Up/Down`

### Find and Replace
- **Find**: `Cmd+F`
- **Find and Replace**: `Cmd+Option+F` (in most apps) or `Cmd+H`
- Type search term, use `Enter` or arrow buttons to navigate matches
- In Replace mode, type replacement text and click "Replace" or "Replace All"

---

## 6. Browser Operations

These shortcuts work in most browsers (Safari, Chrome, Firefox, Edge):

### Tab Management
- **New tab**: `Cmd+T`
- **Close current tab**: `Cmd+W`
- **Reopen closed tab**: `Cmd+Shift+T`
- **Switch to tab by number**: `Cmd+1` through `Cmd+9` (Cmd+9 = last tab)
- **Next tab**: `Ctrl+Tab`
- **Previous tab**: `Ctrl+Shift+Tab`

### Navigation
- **Focus address bar**: `Cmd+L`
- **Go back**: `Cmd+[` or `Cmd+Left`
- **Go forward**: `Cmd+]` or `Cmd+Right`
- **Refresh**: `Cmd+R`
- **Hard refresh** (bypass cache): `Cmd+Shift+R`

### Other Useful Shortcuts
- **Open Developer Tools**: `Cmd+Option+I`
- **View page source**: `Cmd+Option+U`
- **Zoom in**: `Cmd+=`
- **Zoom out**: `Cmd+-`
- **Reset zoom**: `Cmd+0`
- **Full screen**: `Ctrl+Cmd+F`
- **Downloads**: `Cmd+Shift+J` (Chrome) or `Cmd+Option+L` (Safari)

---

## 7. Terminal / Command Line

### Open Terminal
- Press `Cmd+Space`, type "Terminal", and press `Enter`
- This opens Terminal.app (the default macOS terminal)

### Terminal Basics
- **New tab**: `Cmd+T`
- **New window**: `Cmd+N`
- **Switch tabs**: `Cmd+1` through `Cmd+9`, or `Cmd+Shift+[` / `Cmd+Shift+]`
- **Close tab**: `Cmd+W`
- **Clear screen**: `Cmd+K` (clears scrollback) or type `clear` + `Enter`

### Command Control
- **Interrupt command**: `Ctrl+C` (sends SIGINT, stops the running command)
- **Suspend command**: `Ctrl+Z` (sends SIGTSTP, backgrounds the process)
- **End of input**: `Ctrl+D` (sends EOF, may close the shell if empty)

### Text Editing in Terminal
- **Move cursor to start of line**: `Ctrl+A`
- **Move cursor to end of line**: `Ctrl+E`
- **Delete from cursor to start of line**: `Ctrl+U`
- **Delete from cursor to end of line**: `Ctrl+K`
- **Delete previous word**: `Ctrl+W`
- **Search command history**: `Ctrl+R`, then type to search

### iTerm2 (Popular Alternative)
If iTerm2 is installed instead of or alongside Terminal.app:
- Launch via Spotlight: type "iTerm"
- Split pane horizontally: `Cmd+D`
- Split pane vertically: `Cmd+Shift+D`
- Switch between panes: `Cmd+Option+Arrow`
- Other shortcuts are largely similar to Terminal.app

---

## 8. Office Software

### General macOS App Menu Pattern
macOS apps have a menu bar at the top of the screen. To access features:
1. Click on a menu name (File, Edit, View, etc.)
2. Click on the desired menu item
3. Some items have keyboard shortcuts shown next to them

### Microsoft Word / Apple Pages
- **New document**: `Cmd+N`
- **Open document**: `Cmd+O`
- **Save**: `Cmd+S`
- **Save As**: `Cmd+Shift+S`
- **Print**: `Cmd+P`
- **Export to PDF**: File menu > Export as PDF (Pages) or File > Save As > PDF (Word)
- **Bold/Italic/Underline**: `Cmd+B` / `Cmd+I` / `Cmd+U`

### Microsoft Excel / Apple Numbers
- **Navigate cells**: Arrow keys to move between cells
- **Edit cell**: Press `Enter` or double-click on a cell to start editing
- **Confirm entry**: Press `Enter` (moves down) or `Tab` (moves right)
- **Cancel editing**: Press `Escape`
- **Select range**: Click a cell, hold `Shift`, click another cell; or click and drag
- **Select entire row**: Click the row number on the left
- **Select entire column**: Click the column letter at the top
- **Insert formula**: Type `=` followed by the formula (e.g., `=SUM(A1:A10)`)
- **Auto-sum**: Select cells, then look for the sum option in toolbar

### Microsoft PowerPoint / Apple Keynote
- **New slide**: In slide list panel, right-click > New Slide, or `Cmd+Shift+N` (Keynote)
- **Start slideshow from beginning**: Keynote: `Cmd+Option+P`; PowerPoint: look for "Play" button or Slide Show menu
- **Start from current slide**: Keynote: `Option+Cmd+P`; PowerPoint: `Shift+Cmd+Enter`
- **Exit slideshow**: Press `Escape`
- **Switch between edit/presentation mode**: Use the View menu or toolbar buttons

---

## 9. Dev Tools

### Visual Studio Code (VSCode)
- **Launch**: `Cmd+Space`, type "Visual Studio Code" or "code", press `Enter`
- **Command Palette**: `Cmd+Shift+P` — the most powerful shortcut, search for any command
- **Quick Open file**: `Cmd+P` — type filename to quickly open any file in the project
- **Toggle Sidebar**: `Cmd+B`
- **Toggle integrated terminal**: `` Ctrl+` ``
- **New terminal**: `` Ctrl+Shift+` ``
- **Split editor**: `Cmd+\`
- **Go to definition**: `F12` or `Cmd+Click`
- **Find in files**: `Cmd+Shift+F`
- **Find and replace in file**: `Cmd+Option+F`
- **Toggle line comment**: `Cmd+/`
- **Move line up/down**: `Option+Up/Down`
- **Multi-cursor**: `Option+Click` to add cursors at multiple positions
- **Open Settings**: `Cmd+,`
- **Open Extensions**: `Cmd+Shift+X`

### Xcode
- **Launch**: `Cmd+Space`, type "Xcode", press `Enter`
- **Build**: `Cmd+B`
- **Run**: `Cmd+R`
- **Stop**: `Cmd+.`
- **Clean build**: `Cmd+Shift+K`
- **Open file quickly**: `Cmd+Shift+O`
- **Show/hide navigator**: `Cmd+0`
- **Show/hide debug area**: `Cmd+Shift+Y`
- **Show/hide inspector**: `Cmd+Option+0`
- **Toggle between .h and .m/.swift**: `Ctrl+Cmd+Up/Down`
