A macOS-native Node.js utility that automatically watches for new screenshots and uploads them to Raindrop.io using their REST API. Can run as a background daemon or manually.
✨ Core Features:
- 🔍 Continuously monitors screenshot folder (~/Desktop by default)
- 📸 Automatically detects macOS screenshot files (Screenshot YYYY-MM-DD at HH.MM.SS.png)
- 📤 Uploads screenshots to Raindrop.io as file-type raindrops
- 🔐 OAuth 2.0 authentication with token refresh support
- 🏷️ Configurable tags and collection assignment
- 📱 macOS Notification Center integration with clickable URLs
- 📁 Automatic file organization (move to uploaded folder or delete)
🔧 Advanced Features:
- 🚫 Duplicate detection and prevention
- 🔄 Automatic token refresh when expired
- 📝 Detailed logging and error handling
- 🧪 Comprehensive testing utilities
- ⚙️ Highly configurable via environment variables
🚀 Background Service Features:
- 🛠️ Daemon Mode: Runs as a background service on macOS
- 🔄 Auto-start: Automatically starts on login
- 🔗 Clickable Notifications: Click notifications to open uploaded screenshots
- 📊 Quota Monitoring: Real-time storage quota notifications
- 📋 Service Management: Easy start/stop/restart commands
- Node.js 14 or higher
- macOS (for screenshot detection patterns and notifications)
- Raindrop.io account with API access
-
Clone or download this repository
-
Install dependencies:
npm install
-
Run the setup wizard:
npm run setup
Or manually create a
.envfile based on the template:cp config.template .env
-
Configure your settings in
.env:RAINDROP_ACCESS_TOKEN=your_access_token_here RAINDROP_REFRESH_TOKEN=your_refresh_token_here RAINDROP_COLLECTION_ID=123456 SCREENSHOT_FOLDER=/Users/tejas/Desktop UPLOADED_FOLDER=/Users/tejas/Screenshots/Uploaded TAGS=screenshot,macos AUTO_DELETE=false NOTIFICATIONS=true
- Visit Raindrop.io App Center
- Create a new app or use an existing one
- Generate an access token
- Optionally, set up OAuth 2.0 for refresh tokens
Install the daemon (runs automatically on login):
npm run daemon installManage the daemon:
# Check status
npm run daemon status
# View logs
npm run daemon logs
# View errors
npm run daemon errors
# Start/stop/restart
npm run daemon start
npm run daemon stop
npm run daemon restart
# Remove daemon
npm run daemon uninstallnpm start
# or
node watcher.jsThe watcher will:
- Monitor your screenshot folder for new files
- Automatically upload matching screenshots to Raindrop.io
- Show two types of notifications:
- Upload Success: Shows filename with clickable "Show" button to open screenshot
- Storage Quota: Shows remaining storage (e.g., "86.37MB remaining of 95.37MB (9% used)")
- Move uploaded files to the configured folder
When you take a screenshot, you'll receive:
- Title: "Raindrop Upload Success"
- Message: "Uploaded: Screenshot-filename.png"
- Action: Click notification or "Show" button to open the uploaded screenshot in your browser
- URL: Direct link to S3-hosted screenshot
- Title: "Storage Quota"
- Message: "86.37MB remaining of 95.37MB (9% used)"
- Features:
- Real-time quota information
- Works for both free (100MB) and pro (10GB) accounts
- Updates after each upload
- Shows remaining space and usage percentage
npm test
# or
node test_upload.jsThis will:
- Test API connection
- List your collections
- Create and upload a test file
- Check duplicate detection
- Clean up test files
node test_upload.js "/path/to/your/screenshot.png"All configuration is done via environment variables in your .env file:
| Variable | Description | Default |
|---|---|---|
RAINDROP_ACCESS_TOKEN |
Your Raindrop.io access token | Required |
RAINDROP_REFRESH_TOKEN |
OAuth refresh token (optional) | None |
RAINDROP_COLLECTION_ID |
Target collection ID | None (uses default) |
SCREENSHOT_FOLDER |
Folder to watch for screenshots | ~/Desktop |
UPLOADED_FOLDER |
Where to move uploaded files | ~/Screenshots/Uploaded |
TAGS |
Comma-separated tags to apply | screenshot,macos |
AUTO_DELETE |
Delete files after upload | false |
NOTIFICATIONS |
Enable macOS notifications | true |
The utility automatically detects macOS screenshot files by checking:
- Filename starts with "Screenshot"
- Valid image extension (
.png,.jpg,.jpeg)
This catches all macOS screenshot variations including:
Screenshot 2024-01-01 at 10.30.45.pngScreenshot 2024-01-01 at 10.30.45 AM.pngScreenshot 2024-01-01 at 10.30.45 PM.pngScreenshot 2025-07-17 at 1.38.52 PM (2).png(duplicates)- Any other macOS screenshot naming pattern
This utility is fully compatible with Apple Silicon Macs. The daemon automatically detects and uses the correct Node.js path:
- Intel Macs:
/usr/local/bin/node - Apple Silicon Macs:
/opt/homebrew/bin/node
If you encounter daemon startup issues, ensure Node.js is installed via Homebrew:
brew install node- Uses OAuth 2.0 Bearer token authentication
- Automatically refreshes tokens when expired (if refresh token provided)
- Handles authentication errors gracefully
- Uses
PUT /raindrop/fileendpoint - Sends files as
multipart/form-data - Includes metadata (title, excerpt, tags, collection)
- Handles file validation and size limits
- Returns S3 URL for uploaded files
- Uses
GET /userendpoint to fetch storage information - Calculates remaining space and usage percentage
- Supports both free (100MB) and pro (10GB) accounts
- Updates quota information after each upload
- Detailed error logging for debugging
- Handles specific API errors (
file_invalid,file_size_limit,no file) - Graceful fallbacks for network issues
raindrop-screenshot-automation/
├── package.json # Project dependencies
├── config.js # Configuration management
├── raindrop_api.js # API client and authentication
├── watcher.js # Main file watcher logic
├── test_upload.js # Testing utilities
├── daemon-manager.js # Daemon management utility
├── com.raindrop.screenshot.automation.plist # macOS LaunchAgent configuration
├── config.template # Environment variable template
└── README.md # This file
"RAINDROP_ACCESS_TOKEN is required"
- Ensure you've created a
.envfile with your access token - Verify the token is valid by running the test script
"Screenshot folder does not exist"
- Check the
SCREENSHOT_FOLDERpath in your.envfile - Ensure the folder exists and is accessible
"Failed to upload" errors
- Run
node test_upload.jsto diagnose API issues - Check your internet connection
- Verify your access token hasn't expired
Files not being detected
- Ensure files match the macOS screenshot naming pattern
- Check that files are
.pngor.jpgformat - Verify the watcher is monitoring the correct folder
Daemon won't start
- Check if Node.js is installed:
which node - For Apple Silicon Macs, ensure Homebrew is installed:
brew install node - Check daemon logs:
npm run daemon logsandnpm run daemon errors - Reinstall daemon:
npm run daemon uninstall && npm run daemon install
Notifications not working
- Ensure notifications are enabled in your
.envfile:NOTIFICATIONS=true - Check macOS System Preferences > Notifications > Terminal (or your terminal app)
- Grant notification permissions if prompted
For additional debugging, you can:
- Check the console output for detailed error messages
- Run the test script to isolate issues:
npm test - View daemon logs:
npm run daemon logs - Check daemon status:
npm run daemon status - Verify API responses in the test output
The codebase is modular and easy to extend:
config.js- Add new configuration optionsraindrop_api.js- Add new API endpoints or methodswatcher.js- Modify file watching or processing logictest_upload.js- Add new test scenariosdaemon-manager.js- Enhance daemon management features
# Run all tests
npm test
# Test specific functionality
node test_upload.js
# Test with custom file
node test_upload.js "/path/to/file.png"
# Test daemon functionality
npm run daemon status
npm run daemon logs| Command | Description |
|---|---|
npm run daemon install |
Install daemon (auto-starts on login) |
npm run daemon uninstall |
Remove daemon completely |
npm run daemon start |
Start the daemon |
npm run daemon stop |
Stop the daemon |
npm run daemon restart |
Restart the daemon |
npm run daemon status |
Check if daemon is running |
npm run daemon logs |
View recent logs |
npm run daemon errors |
View recent errors |
- 🍎 Package as a macOS menu bar app
- 🎨 GUI for configuration management
- 🔍 More sophisticated duplicate detection
- 📊 Upload statistics and monitoring dashboard
- 🔒 macOS Keychain integration for token storage
- 📱 iOS companion app integration
- 🌐 Cross-platform support (Windows, Linux)
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
MIT License - see LICENSE file for details
For issues or questions:
- Check the troubleshooting section
- Run the test script for diagnostics:
npm test - Check daemon logs:
npm run daemon logs - Check Raindrop.io API documentation
- Create an issue in the repository
Note: This utility is designed for macOS and uses macOS-specific screenshot patterns and notification systems. While the core functionality may work on other platforms, full compatibility is not guaranteed.