Created
June 7, 2018 08:00
-
-
Save hyuki/0ead100dbfaa3a40c11423279ff9744e to your computer and use it in GitHub Desktop.
ulysses-import - Import a given text to Ulysses.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# https://ulyssesapp.com/kb/x-callback-url/ | |
require 'uri' | |
FORMAT = 'text' # html, markdown | |
GROUP = URI.escape('Imported Text') | |
if ARGV.length == 0 | |
puts "Usage: ulysses-import textfile.txt" | |
abort | |
end | |
text = URI.escape(IO.readlines(ARGV[0]).join) | |
system(%Q(open "ulysses://x-callback-url/new-sheet?text=#{text}&group=#{GROUP}&format=#{FORMAT}&index=0")) |
Author
hyuki
commented
Jun 7, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment