Creating MediaProcessor.app Automator Droplet¶
This guide walks you through creating a drag-and-drop Automator application for processing media files.
Prerequisites¶
- macOS with Automator (pre-installed on all Macs)
- This repository cloned (adjust the path in the script below to match your clone location)
Step-by-Step Instructions¶
1. Open Automator¶
- Press
⌘ + Spaceto open Spotlight - Type "Automator" and press Enter
- Automator will launch
2. Create New Application¶
- In the template chooser, select "Application"
- Click "Choose"
3. Configure Workflow¶
- In the left sidebar, search for "Run Shell Script"
- Drag "Run Shell Script" to the workflow area
- Configure the action:
- Shell:
/bin/bash -
Pass input:
as arguments -
Replace the default script content with:
#!/bin/bash
# Change to your mac-server-setup clone directory
REPO_DIR="${HOME}/Developer/mac-server-setup"
cd "${REPO_DIR}/app-setup/templates" || exit 1
# Process each dropped item
for media_dir in "$@"; do
# Validate it's a directory
if [[ ! -d "${media_dir}" ]]; then
name=$(/usr/bin/printf '%s' "${media_dir}" | /usr/bin/sed "s/[\"\\\\]/\\\\&/g")
osascript -e "display notification \"${name} is not a directory\" with title \"Media Processor\" sound name \"Basso\""
continue
fi
# Export variables for compatibility with transmission-done.sh
export TR_TORRENT_DIR="${media_dir}"
export TR_TORRENT_NAME
TR_TORRENT_NAME="$(basename "${media_dir}")"
# Log the processing
echo "Processing: ${media_dir}"
# Run the main script
safe_name=$(/usr/bin/printf '%s' "${TR_TORRENT_NAME}" | /usr/bin/sed "s/[\"\\\\]/\\\\&/g")
if ./transmission-done.sh; then
osascript -e "display notification \"Successfully processed ${safe_name}\" with title \"Media Processor\" sound name \"Glass\""
else
osascript -e "display notification \"Failed to process ${safe_name}\" with title \"Media Processor\" sound name \"Basso\""
fi
done
4. Save the Application¶
- Press
⌘ + Sor go to File → Save - Save As:
MediaProcessor - Where: Choose your preferred location (recommended:
~/Applications/or Desktop) - File Format: Should already be set to "Application"
- Click "Save"
5. Test the Application¶
- Find a test media directory (or create a dummy one)
- Drag and drop the directory onto
MediaProcessor.app - The app should:
- Show a folder picker if you don't drag anything
- Process the media files
- Show a notification when complete
- Play a sound (Glass for success, Basso for failure)
Usage¶
Drag-and-Drop Mode¶
- Drag a folder containing media files onto
MediaProcessor.app - The app will process all media files in that folder
- You'll receive a notification when complete
Double-Click Mode¶
- Double-click
MediaProcessor.app - A folder picker dialog will appear
- Select the folder containing media files
- The app will process the files
- You'll receive a notification when complete
Troubleshooting¶
"MediaProcessor.app can't be opened"¶
This security warning may appear on first run:
- Right-click (or Control-click) on
MediaProcessor.app - Select "Open" from the context menu
- Click "Open" in the security dialog
- This only needs to be done once
No notifications appearing¶
- Open System Settings → Notifications
- Find "Script Editor" or "Automator" in the list
- Enable notifications for that application
Script fails to run¶
- Check that the path in the script matches your repository location
- Verify
transmission-done.shis executable:chmod +x transmission-done.sh - Check Console.app for error messages
Advanced: Creating App Icon¶
To add a custom icon to your Automator app:
- Find or create an
.icnsfile - Right-click
MediaProcessor.app→ "Get Info" - Drag your icon file onto the small icon in the top-left of the Info window
- Close the Info window
Additional Notes¶
- The app runs in manual mode (uses
prompt_for_directory()if no items dropped) - All processing logs are written to the configured log file
- The app inherits your user environment, so FileBot and other tools must be in your PATH
- Notifications use native macOS notification system