Last active
December 13, 2015 17:38
-
-
Save mfcabrera/4949467 to your computer and use it in GitHub Desktop.
A script using MacRuby to export all the todos from Things projects into text files (my goal is to "copy and paste" them into 2DO.
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
#make sure you use macruby | |
framework "ScriptingBridge" #let's use the scripting bridge framework | |
# this is aweful - maybe a wrapper would be nice | |
# you can ge this BundleIdentifier using the mdls | |
# mdls -name kMDItemCFBundleIdentifier /Applications/Things.app | |
things = SBApplication.applicationWithBundleIdentifier("com.culturedcode.things") | |
# lets get the projects that is what I am interested in | |
# the propertie is called "to dos" but it marshaled as "toDos" | |
# this is found nowhere in the documentation | |
#this is the weirdest thing - the property status does not return | |
# a string as defined in the documentation but a code. | |
# i had to "reverse engineer" this and I am not sure if it will | |
# work in all the systems | |
open_code = 1952737647 | |
things.projects.each { |pr| | |
File.open("#{pr.name}.txt", 'w') { |f| | |
pr.toDos.each {|todo| f.puts todo.name if todo.status == open_code } | |
} if pr.status == open_code | |
} | |
#that's all folks! - easy isn't it... :S | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More info: http://mfcabrera.com/geekness/2013/02/13/From-Things-2DO.blog.org.html