snamiki1212/alfred-url2md-golang

Suggests to automatically use clipboard content as default input

Opened this issue · 0 comments

Thanks for this useful workflow.

Here are the steps I use aflred-url2md:

  1. Copy a URL into clipboard.
  2. Open Alfred
  3. Type the keyword url to choose alfred-url2md workflow.
  4. Press Command-V to paste URL.
  5. Press Enter

With clipboard content as default input,
We can just skip the step 4 to paste a URL into Alfred.

Here is my solution:

  #!/bin/zsh
- query=$1
+ query="${1:-""}"
+ if [[ "${query}" == "" ]]; then
+     query="$(pbpaste)"
+ fi

  ...

When user doesn't input an URL,
just use pbpaste to get clipboard board

thanks