Skip to content

Instantly share code, notes, and snippets.

@stubevan
Created April 4, 2019 11:28
Show Gist options
  • Save stubevan/503f9e40300437b174568d4774cd55b0 to your computer and use it in GitHub Desktop.
Save stubevan/503f9e40300437b174568d4774cd55b0 to your computer and use it in GitHub Desktop.
Loading a file into omnifocus
#!/bin/bash
for file in test1.txt test2.jpg
do
url="omnifocus:///add?name=${file}&attachment-name=${file}&attachment="
base64str=$(base64 -w 0 $file)
urlencstr=$(php -r "echo rawurlencode('${base64str}');")
url="${url}${base64str}"
open $url
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment