TaskPaper for iOS

Any good text editor will work with TaskPaper files.

Editorial is great, as it supports the TaskPaper format, and it is scriptable. For a while, it was not updated, so I moved on from it.

I now use 1Writer and am quite happy with it on my iPhone. I use iCloud for syncing my TaskPaper files.

1 Like

I second that. [1Writer](https://1writerapp.com) is a good iOS editor, and, like TaskPaper, has [a JavaScript API](JavaScript Documentation - 1Writer) for customizations.

I am not a JavaScript expert and it only took me an evening to make these scripts in 1Writer:

3 Likes

Here is my @done script, which adds the current date:

let leftPad = (digit) => {
	let str = digit.toString()
	return digit >=10 ? str : 0 + str;
}

let date = new Date()
let year = leftPad(date.getFullYear())
let month = leftPad(date.getMonth() + 1)
let day = leftPad(date.getDate())
editor.replaceSelection(` @done(${year}-${month}-${day})`)
3 Likes

And if you wanted, you could include a local time-stamp in your 1Writer @done tags:

Variant of @Jim's 1Writer action, adding a local time-stamp
(() => {
    'use strict';

    // Variant of @Jim's 1Writer action script to
    // include a local time-stamp in the @done tag

    // main :: IO ()
    const main = () =>
        editor.replaceSelection(
            `@done(${taskPaperDateString(new Date())})`
        );

    // --------------------- GENERIC ---------------------

    // iso8601Local :: Date -> String
    const iso8601Local = dte =>
        new Date(dte - (6E4 * dte.getTimezoneOffset()))
        .toISOString();

    // taskPaperDateString :: Date -> String
    const taskPaperDateString = dte => {
        const [d, t] = iso8601Local(dte).split('T');
        return [d, t.slice(0, 5)].join(' ');
    };

    return main();
})();
3 Likes

Yes, please reconsider supporting an iOS app!!

I’ve tried any and all apps that are compatible with TaskPaper and I just can’t obtain the same efficiency and features that TaskPaper provides. For instance, I use TaskPaper to organize my notes between MarginNote and DEVONthink and I use the links embedded as notes under projects and tasks to specific annotations, however the links are only detected in TaskPaper. TaskMator can detect them but you have to open a separate window and memorize the URL to know which to click. The rest don’t render them unless you use the proper markdown syntax which defeats the purpose of just embedding links as notes.

TaskPaper has met the precise crosspoint of elegance and simplicity with practicality and efficiency. That’s hard to accomplish and yet TaskPaper continues to hold strong in that position among many other apps.

2 Likes

Thanks so much for this - and I’m sorry for my late reply! Somehow, I didn’t get any notice that you posted this.

I’d mostly use certain TaskPaper files for my iPad - and I’d need to sync them. So, would you still suggest using 1Writer (or some other app) for that purpose, while setting it up to sync TaskPaper files?

I don’t quite follow how you used the JavaScript for the set up, but I’ll follow up with that later.

Thanks again for your help!

It depends on how how you want to sync your TaskPaper file(s)—as some apps only support one syncing service.

I use iCloud now, so 1Writer works well for me.

If I used Dropbox for syncing, I would probably use Editorial.

TaskMator lost data on me several times, so I won’t touch it now. It does have the advantage of being designed for TaskPaper, so you won’t have to do scripting.

Don’t worry about the scripting, until you choose an app (as they use different scripting languages).

1 Like

@Jim,

does 1Writer support folding? Editorial can collapse only projects, everything else keeps expanded. Working with large files is no fun.

Nils

Hi @nilsw

It does not.

It does have a good search function—I made a script that will exclusively show lines that have @today in them.

Docs: editor - JavaScript Documentation - 1Writer

But this is a workaround, not proper folding/collapsing.

I use Dropbox for syncing most of my files. What advantage does iCloud provide for Taskpaper syncing?

Nothing in particular.

I switched to iCloud, as I wanted to minimize how many utilities I run on my Mac, and I had a few conflicted copy issues with Dropbox.

just use the Editorial app, it’s insanely good and 100% covers my TaskPaper needs. It’s a godsend.

I am looking into moving away from dropbox so 1writer seems very interesting.
Is there syntax highlighting for task paper?
I it ok for you to share your setup. (I’m unfortunately not very good at scripting…)

There is no TaskPaper syntax highlighting in 1Writer.

I’m ahoy to share any of the scripts that I have written. If you see an interesting one in the screenshot above, tell me the name and I will post the code here.

That is very kind of you.
If it’s not too much trouble can you please post:
List @Today, +Task, Prepend dashes, Select current line and Move Up?

1 Like

@Today:

var content,
    lines,
    headings,
    lengths,
    ranges,
    linesLength,
    i;

content = editor.getText();
lines = content.split('\n');
linesLength = lines.length;
lengths = 0;
headings = Array();
ranges = Array();

for(i = 0; i < linesLength; i++) {
    if(lines[i].match(/@today+\s?.*/)) {
        headings.push(lines[i]);
        ranges.push(lengths);
    }
    lengths += lines[i].length + 1; // +1 because the line breaks count;
}

if (headings.length > 0) {
    ui.list('Jump to Section', headings, false, function(a,b) {
        if (b === undefined) {
            ui.hudError("Ok");
        } else {
            editor.setSelectedRange(ranges[b])
        }
    });
} else {
    ui.hudError("There's nothing tagged");
}

+Task:

editor.replaceTextInRange(0, 0, '\n');
editor.replaceTextInRange(0, 0, '\t- ');

Prepend dashes:

const text = editor.getSelectedText();
var lines = text.split("\n");
lines = lines.map(function(l) { 
    return '	- '+l;
});
editor.replaceSelection(lines.join("\n"));

Thank you Jim. very kind.
Now I’ll see if this works for me. :slight_smile:

1 Like