Created
November 25, 2009 00:04
-
-
Save jeffrydegrande/242350 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# 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