From b235ba27ad6788f89c1d06119872b30123b5d879 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 8 Dec 2025 16:00:21 +0100 Subject: [PATCH] Add example for Automator Script (Quick Action) to README.md --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index 687985f..f1383b1 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,37 @@ python beautify-audio.py ~/Downloads/Track.wav \ --auth-file ~/secrets/onetagger-auth.json ``` +## Example for Automator Script (Quick Action) +```bash +set -euo pipefail + +# Where the repo lives +SCRIPT_ROOT="/path/to/beautify-audio" +PY_SCRIPT="$SCRIPT_ROOT/beautify-audio.py" + +# Make sure Homebrew binaries are visible (ffmpeg, etc.) +export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" + +LOG_DIR="$HOME/Library/Logs" +LOG_FILE="$LOG_DIR/beautify-audio-$(date +%Y%m%d-%H%M%S).log" +mkdir -p "$LOG_DIR" + +# Make sure a virtual environment with the requirements installed is available +source "$SCRIPT_ROOT/.venv/bin/activate" + +{ + echo "==== $(date) ====" + for src in "$@"; do + echo "Processing: $src" + /usr/bin/env python3 "$PY_SCRIPT" "$src" + done +} >>"$LOG_FILE" 2>&1 + +osascript -e "display notification \"Beautify Audio finished for $# file(s).\" with title \"Beautify Audio\"" + +``` + + ## Notes - Automator-friendly: one input file in, one clean MP3 out. - If OneTagger is missing or fails, conversion and cleanup still run; renaming uses best-effort metadata.