Skip to content

Instantly share code, notes, and snippets.

@jeffrydegrande
Created November 25, 2009 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jeffrydegrande/242350 to your computer and use it in GitHub Desktop.
Save jeffrydegrande/242350 to your computer and use it in GitHub Desktop.
# Import your 'Today' list from Things into PomoDo;
require 'rubygems'
begin
require 'appscript'
rescue LoadError
puts "You need to install the rb-appscript gem"
exit
end
begin
require 'sqlite3'
rescue LoadError
puts 'You need to install the sqlite3 gem'
exit
end
def db_path
File.join(ENV['HOME'], 'Library/Preferences/com.area.pomodo.71736089A4FD7F25640D5DFCD1E08B026503305A.1/Local Store/PomoDo.db')
end
if File.exists?(db_path)
db = SQLite3::Database.new(db_path)
app = Appscript.app('Things')
app.lists['Today'].to_dos.get.each do |todo|
db.execute("INSERT INTO tasks (name, status, closed, created_at) VALUES (?, ',,,,,,,,,,,', 0, date('now'))", todo.name.get)
end
else
puts 'Install PomoDo: http://pomodo.areacriacoes.com.br'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment