Is it possible to jump instantly to a project inside TaskPaper doc


#1

I want to create a KM macro that will jump to a certain project and focus in on it. Basically what the Go to Project.. search does but without triggering the palette.

So I can run it from my browser and it switches to TaskPaper with the specified project in focus.

Is this possible to do?


TaskPaper Extensions Wiki
#2

You can do this with AppleScript by setting focusedItem on the OutlineEditor.


#3

@jessegrosjean — can you show an example AppleScript to focus Inbox?


#4

This script focuses top level “Inbox” project. If such a project doesn’t yet exist it creates it, and then focuses it.

function TaskPaperContext(editor, options) {
	let outline = editor.outline
	let inbox = outline.evaluateItemPath('/project Inbox')[0]
	if (inbox == null) {
		inbox = outline.createItem('Inbox:')
		outline.root.insertChildrenBefore([inbox], outline.root.firstChild)
	}
    editor.focusedItem = inbox
}

Application('TaskPaper').documents[0].evaluate({
  script: TaskPaperContext.toString()
});

Add ability to quickly switch open projects with ctrl/cmd + 1/2/3/
#5

Thanks @jessegrosjean!

Edit: I set this up for a few projects and have been using it this afternoon—I love it! Kudos!