Here is a script to remove the friction of manually typing and deleting a @now or @next tag of this kind. It can be attached to a keystroke with something like Keyboard Maestro or FastScripts.

The script:

Places a @now tag at the top of the outline if there is no such tag in the file

If there is already a @now tag somewhere, it just moves it on to the next task that is not @done, unfolding part of the outline to make the newly tagged line visible, if necessary.

That’s it, but also:

If you edit the 1 (or true) argument in the last line of the script to 0 (or false), you can save it as a second script which moves the tag upwards rather than downwards in the outline:

to a preceding sibling if there is one,

or to the immediate parent.

and

If you are using TextBar to display the line marked with @now, you can also trying editing the 3rd argument to the main function (right at the end of the script) to 1 rather than 0.

This will force TextBar to update its display of your current task each time this script moves your @now or @next tag.

(It’s using a bit of an unsophisticated approach – if you are using TextBar, do write a quick note to its author to support the request for an Applescript .refresh() method which can trigger an immediate refresh a little more rapidly and elegantly : - )

The section of the script marked Evaluated in TP3 (between rows of asterisks) is evaluated by TaskPaper itself, rather than by Script Editor / osascript, but is still the same webkit/Safari dialect of JavaScript.

(You can write the outer part of a TP3 script in Applescript, but you would still have to pass some JavaScript (as a string) to the TP3 document.evaluate() function. (JavaScript is the native scripting language of TaskPaper 3).

(JavaScript is so widely used on the web and elsewhere, that learning even a little does quickly reap rewards, not only on the web and OS X. but also on iOS, where it is the scripting vehicle of things like iOS Drafts, and can be used with the iOS (and OS X) versions of TextExpander.

Keyboard Maestro has actions for executing JavaScript for Applications (as well, of course, as browser JavaScript),

and in a shell script, or in Terminal.app you can run JS for apps (or ‘JXA’) by wrapping it as follows:

If you would like it to move only from task to task (skipping projects and notes) you can edit the line (middle of script):

'::(not @done)[' + (blnDown ? '0' : '-1') + ']'),

changing it to:

'::(@type=task and not @done)[' + (blnDown ? '0' : '-1') + ']'),

If you would like to force an update to the TaskBar display (in advance of the refresh interval), you can edit the last line of the script to change the final zero to a one. (i.e. giving blnTextBar a non zero value).

Is there any behaviour that you had in mind, or would like to see ?

(The goal of the script is simply to streamline moving from one task to another, without having to manually delete and move/type the bookmark tag. One option that could be simply added to it would be flagging a task as @done – possibly with a timestamp – before moving the @now tag on to the next task).

Good shopping list : - ) JavaScript has a useful conditional operator The best quick reference on JavaScript is the Mozilla documentation, and light will be shed on several of your questions by the page which describes JavaScript’s very useful conditional operator condition ? expressionA : expressionB which is similar to if (condition) { statementA } else { statementB } but has the advantage that it is itself an expression (i.e. it returns a useable value), rather than a stateme…

here is an alternative version, with one or two sections rewritten to break them down into stages, with a few more comments, and a few more named variables (to replace direct composition)

This script was written during the TaskPaper 3 Beta, before the final scripting interface was adopted.

Here is an update in two parts:

The Javascript for Automation source

An updated version of the .sh file for TextBar

In TextBar > Preferences > Advanced, you will need to make sure that the text field is clear (perhaps removing the default -l switch, which results in a display of shell variables, displacing the script output)

An update - the version that I am currently using. (Requires TaskPaper 3 and macOS Sierra onwards)

Again, this script just:

moves a @now tag on the the next available item

optionally flags the previous@now item as @done(timestamped)

optionally updates a TextBar display of the current @now item and its context (parent, and any grandparent)

Optionally issues a macOS notification and sound. (One sound for a new available item, another sound for a completed outline)

Next available item means, for example, the next outline leaf (childless item) which is not @done

The movement through the outline is ‘bottom up’, or ‘preorder’ (children before parents). The @now tag moves to parent items only after all of their descendants are @done (so that the parent itself can be marked @done, if that is what is wanted)

( Items of all types are visited in the same way – projects, tasks and notes – I seem to be working these days with very few bullets and project colons – mostly just unadorned outlines )

This is a JavaScript for Automation script, for installation and use see:

Scripts are made of Javascript (and maybe AppleScript) code that you paste into the “Script Editor” application to run.
To try a script:
Create a new test document in TaskPaper.
Open the “Script Editor” app and paste the the script into a new “Script Editor” document. Depending on how the script was coded, most of the time you’ll need to change the editor window mode from “AppleScript” to “JavaScript” This can be done in a popup in the upper left of the document window.
Then press the …

An update, after some years, of a Keyboard Maestro macro for TaskPaper which I thought I had posted here but can't immediately track down: The macro (requires TaskPaper 3, macOS Sierra onwards) just: moves a @now tag on the the next available...