TaskPaper: Absolute Link to Relative Link [LaunchBar Action]

This LaunchBar action is a utility for usage with TaskPaper. 

TaskPaper is a great plain-text outliner and task manager, but I’m sure you know that already.

In TaskPaper you can create links to other files by dragging them to an open document window. This will create an absolute link.

However, often you are linking to files that are in the same directory as the TaskPaper document, or in the same directory hierarchy, for example inside a common project folder.

When you move or rename the parent project folder, then absolute file links will break. What you need here are relative links1:

That’s where this action comes in.

Usage

  1. Open or create a TaskPaper document that contains one or more file links. Make sure the document is saved to disk.
  2. In the document select a file link from the starting slash to the last char of the path.
    • Instead of selecting one link you can also select any text range that contains file links. The action will try to find any links and convert them.
  3. Use your LaunchBar Instant Send key to send the selected text to LaunchBar.
  4. Bring up the action in LB, e.g. by typing its abbreviation.
  5. Once the action is selected in LB, hit Shift-Return to run the action and replace the current text selection with the result (i.e. the relative link(s)).
    • Alternatively press Return and then Command-C to copy the result to the clipboard.

In the comment section at the end of the script file (default.pl) you find further usage notes and some technical details.

The script itself is heavily commented, so you will find it easy to make adjustments or eliminate bugs.

Requirements

  • LaunchBar
  • TaskPaper
  • perl with JSON module (should be part of macOS’ standard perl installation).2

Download

Download (1.0.1 / 2017-05-21)

Footnotes

  1. With the document as reference point.
  2. If not, install it via cpanm, or post a comment if you don’t know how to install perl modules.