#!/bin/sh

TITLE="$1"
URL="$2"

if [[ "$TITLE" != "" ]] && [[ "$URL" != "" ]]; then
  osascript -e "tell application \"Safari\" to add reading list item \"${URL}\" with title \"${TITLE}\""
else
  echo "usage: `basename $0` <title> <url>"
  exit 1
fi
