Skip to content

Instantly share code, notes, and snippets.

@aberezin
Created June 25, 2022 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aberezin/a168c5553057ea1eee79458a1364c2f2 to your computer and use it in GitHub Desktop.
Save aberezin/a168c5553057ea1eee79458a1364c2f2 to your computer and use it in GitHub Desktop.
fantastical command line
#!/usr/bin/env bash
if [[ "${1/--help/-h}" == '-h' ]]; then
echo 'fan2add [-h | --help]'
echo 'fan2add [-i | --immediately] statement...'
echo
echo '##### Statement Examples ########'
cheat fantastical-statements
exit
fi
if [[ "${1/--immediately/-i}" == '-i' ]]; then
immediately="with add immediately"
shift
fi
osascript <<EOF
tell application "Fantastical 2"
parse sentence "$*" $immediately
end tell
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment