droplr.plugin.zsh 345 B

12345678910111213141516
  1. # Only compatible with MacOS
  2. [[ "$OSTYPE" == darwin* ]] || return
  3. droplr() {
  4. if [[ $# -eq 0 ]]; then
  5. echo You need to specify a parameter. >&2
  6. return 1
  7. fi
  8. if [[ "$1" =~ ^https?:// ]]; then
  9. osascript -e 'tell app "Droplr" to shorten "'"$1"'"'
  10. else
  11. open -ga /Applications/Droplr.app "$1"
  12. fi
  13. }