I found a method using Chrome console. I run this in chrome console, after filtering on the tasks I wish to export in doit.im.
function contextLookup(ctxId) {
var arr = Doit.contexts;
for(var i=0; i< arr.length; i++) {
if (arr[i].uuid == ctxId) return arr[i].name;
}
return "missing";
}
function projLookup(projId) {
var projects = Doit.projects;
for(var i=0; i< projects.length; i++) {
if (projects[i].uuid == projId) return projects[i].name;
}
return "missing";
}
var tagSeparator = "&";
var allTaskLines = "";
var noTasks = TASKS.length;
for (var i = 0; i < noTasks; i++) {
var task = TASKS[i];
var thisTaskLine = task.title;
var thisTaskLine = thisTaskLine +" !p"+task.priority;
var thisTaskLine = thisTaskLine +" ^"+task.attribute;
var thisTaskLine = thisTaskLine +" #"+projLookup(task.project);
var thisTaskLine = thisTaskLine +" @"+contextLookup(task.context);
var tags = task.tags;
if (!(typeof tags === 'undefined')) {
var noTags = task.tags.length;
for (var j = 0; j < noTags; j++) {
thisTaskLine = thisTaskLine + " " + tagSeparator + tags[j];
}
}
if (!(typeof task.notes === 'undefined')) {
// replace new lines in notes with '/n', because I want one task on each line
var notes = task.notes.replace(/[\r\n]/g, "/n").replace(/[\n]/g, "/n");
var thisTaskLine = thisTaskLine +" [["+notes+"]]";
}
allTaskLines = allTaskLines + thisTaskLine + "\n";
}
console.log(allTaskLines);
copy(allTaskLines);
Also see here https://coderwall.com/p/yk64la .
It seems possible to do the export using a javascript in the Google Chrome Console. Here Coderwall managed to export the task names: see https://coderwall.com/p/yk64la. I'm sure its possible to export the tags as well, because I can see an array of objects with the taskname, context and tag information in the Google Chrome console, but I don't know get to it programmatically. I'm sure a Chrome experienced web-developer would be able to retrieve the info quickly. I'm kind of stunned that it seems so easy to get to the export with tags, and so many have requested it for so long, but Doit.im has still no obvious way to create an export with tags and context info.
Best Alex
-
04/28/2014 19:46#1PRO
-
05/02/2014 07:04#2PRO
Or get it here: https://github.com/arberg/doitimExport
-
03/20/2015 21:16#3PRO
Hi Arberg - I modified your script to have tabs separate the data rather than tags, this allowed me to import the clipboard into Excel.
There are a couple issues -
I have to do a search/replace on the /n in the notes to replace with CTRL-J (haven't figured out how to do this in the JS)
I have to search/replace HTML codes like ' (apostrophe)
The tag lookup can either be blank or return multiple values, so I moved it to the end of the string
The note lookup can be blank so I added a default tab
Question for you - do you know how to add the Focus to this output? (Today, Next, Waiting, etc)? -
03/20/2015 21:59#4PRO
Never mind, I figured out that they all match up except that task.attribute "plan" includes Today, Tomorrow and Scheduled. So what I need is the date and time information.