Hello all!
I am using a JavaScript that creates a specific project and tasks. I use this daily, to set up my regular practice sessions.
I want to indent every other line as a child, but my attempted use of \t is not working.
Currently, the script creates:
— Practice Sessions → 1/9:
- Session A → 6:30—7:30 → Cards →
- Practice 1
- Session B → 8:30—9:30 → Coins →
- Practice 2
- Session C → 10:30—11:30 → Sleight-of-Hand →
- Practice 3
But I want it to be this:
— Practice Sessions → 1/9:
- Session A → 6:30—7:30 → Cards →
- Practice 1
- Session B → 8:30—9:30 → Coins →
- Practice 2
- Session C → 10:30—11:30 → Sleight-of-Hand →
- Practice 3
Any ideas on how to do this?
The script:
function TaskPaperContext(editor, options) {
const d = new Date();
const dtd = d.getMonth() + 1 + "/" + (d.getDate() + 1);
let outline = editor.outline
let project = outline.createItem('— Practice Sessions → ' + dtd + ":")
project.appendChildren([
outline.createItem('- Session A → 6:30—7:30 → Cards → '),
outline.createItem('- Practice 1'),
outline.createItem('- Session B → 8:30—9:30 → Coins → '),
outline.createItem('- Practice 2'),
outline.createItem('- Session C → 10:30—11:30 → Sleight-of-Hand → '),
outline.createItem('- Practice 3')
])
let now = editor.outline.evaluateItemPath('project Now:')[0]
now.parent.insertChildrenBefore(project, now)
editor.moveSelectionToItems(project, 0, project, 0)
}
Application('TaskPaper').documents[0].evaluate({
script: TaskPaperContext.toString()
});