ExtraInfo
FYI, this project is listed as "retired." It may no longer function or I may just not be updating it anymore.
Multi-App wiki magic
Introduction
The ExtraInfo service brings the features of the TaskPaper script ExtraInfo to any app you’re editing text in. It runs as a macOS Service that you can run with a shortcut key on highlighted text containing an “info link” and a note will be opened (and created if needed). You can expand on ideas inside mind map nodes, link notes to tasks in OmniFocus, link notes in nvALT to MindNode maps, and so on. It functions like a big multi-app wiki. Anywhere you can type text, you can link additional information in any format you need.
You can define different “types” for notes, so you can store your info in an OmniOutliner outline, an nvALT note, or even an iThoughts or MindNode mind map, and have different types of notes for different scenarios. Almost any application that stores its documents on your disk can be a note hub.
ExtraInfo recognizes the original TaskPaper tag syntax, so @note(ExtraInfo documentation)
will open your configured “note” app with a document called “ExtraInfo documentation.” In my setup (and the default configuration), this creates or opens an nvALT document. And using @map(ExtraInfo documentation)
opens an iThoughtsX mind map called, you guessed it, “ExtraInfo documentation.”
Created notes can also have backlinks to the place where you linked to them. So typing “@map(ExtraInfo Documentation)” in MultiMarkdown composer while I’m writing this creates a mind map for brainstorming and outlining, or I can add “@tree(ExtraInfo Documentation) and have an additional Tree 2 outline, and then easily jump back and forth between all of them.
It also handles [[wiki links]]
. Surrounding any text with double brackets will cause it to open using the first app in the configuration file. You can specify a type, though, using a pipe at the end: [[ExtraInfo documentation|map]]
.
Installation
Download and unzip the project and open the resulting folder. Inside, you’ll see a config file, a folder of templates, and ExtraInfo.workflow.
- Copy ExtraInfo.workflow to ~/Library/Services (the
~
is your home folder, see the how-to for more detail) - Create a folder in your home directory called “config” (if it doesn’t exist), and a folder inside that called “extrainfo”
- Copy the template folder and all of its contents into
~/config/extrainfo/
(all of the templates should now reside in~/config/extrainfo/templates/Template.*
)
By default, ExtraInfo looks for its configuration and templates in ~/config/extrainfo
. If this folder doesn’t exist, it will be created the first time ExtraInfo runs, and a default config file will be placed in there. You still need to copy the templates from the download in manually.
You probably want to assign a shortcut key to the Service to make using it as easy as possible.
Configuration
The config.yaml file in ~/config/extrainfo/
is where you’ll edit all of the files and apps associated with your notes. You can add or remove any apps you want or don’t need, and modify the @keyword that will trigger them.
Here’s a default configuration:
# The base folder all paths will be relative to. If blank, use absolute paths
baseFolder: "~/Dropbox/"
# The folder where your templates are stored, must end in trailing slash
templateFolder: "~/config/extrainfo/templates/"
# Your keywords for app triggers
# First key is default for wikilinks
apps:
note:
docPath: "nvALT2.2/"
template:
name: "Template.md"
nested_file: false
zip: false
app: "nvALT"
baseFolder
is the top level folder from which all of your other notes folders exist. If they’re all in different locations, you can leave this blank and use absolute paths in the individual configurationstemplateFolder
is the location where the templates for different types of notes are stored. This can be anywhere, but all templates need to be in one folderapps
configuration- the main key for the app definition is the keyword you’ll use to trigger the template, e.g.
@note(note title)
as defined in the sample above docPath
is where created notes will be stored. This will be treated as a subdirectory off of thebaseFolder
app
is the name of the application that will be used to open the created documents. Examples would be “nvALT”, “iThoughts”, “Tree 2”, etc. The name must match the application name, and work in an open command:open -a AppName filename
.- the template key has three parts
name
is the filename of the template. This file must existnested_file
is for templates that are actually folders, this would be the path to the main file containing the contents of the note is stored. For example, in a MindNode document, the actual map data is an xml file calledcontents.xml
in the root of the document bundle. If the file is just a single text file (or OPML, XML, etc.), you can just set this to falsezip
is for apps that require bundles to be in a compressed format. If you need this, set zip to the file extension of the compressed bundle format for the app. In the case of iThoughts, this would beitmz
. Set it tofalse
to disable
- the main key for the app definition is the keyword you’ll use to trigger the template, e.g.
Templates
By default, ExtraInfo is configured for:
@note
triggers nvALT using Template.md@node
triggers MindNode using Template.mindnode@map
triggers iThoughtsX using Template.itm@outline
triggers OmniOutliner using Template.oo3@tree
triggers Tree 2 using Template.opml
Creating templates
I won’t go into all the gory details of creating a template file, but you can figure a few things out just by digging in the provided templates. In most cases it’s just a matter of creating a blank document in the app, saving it to disk, and then taking a look at its source contents to add any variable placeholders needed.
Extracting a compressed bundle format can be tricky as different formats use different compression, but in general, if the document is binary and isn’t a folder you can access in Finder with right click, Show Package Contents, then it’s probably compressed. You can try unzip [bundlefile]
in Terminal and see what happens. If that works, you can use the unzipped version of the bundle as the template, and set the zip
key to the original bundle extension.
Similarly, if a file is stored as a binary plist, you’ll need to convert it. To see if that’s the case, run file [bundlefile]
, and if it’s a binary PLIST, use plutil -convert xml1 [xmlfile]
.
Variables
The following placeholders can be inserted into a template and they’ll be filled in any time a new note is created.
%%TITLE%%
is generated from the tag value (@note(This would be the title)
), or the task name if that’s empty- %%DATE%% is the ISO date at the runtime
- %%FILEPATH%% is the system path to the document from which the note was created, i.e. where the note link was when you ran ExtraInfo
Notes coming from nvALT and OmniFocus get special urls to link directly to the originating note or task.
Limitations
ExtraInfo doesn’t work with apps like Bear that have no files on disk. You can have it create a note or open with the url scheme, but it can’t tell the script if the file already exists and there’s no “create if missing” option in most cases.
I’ll see if I can figure out a way to expand this in the future, but for now it’s easiest just to use any available “Copy Link” option and paste a link to the note into the file you’re adding extra info to.
Download
ExtraInfo Service v1.0.1
Download ExtraInfo Service v1.0.1
A service for attaching extra notes using wiki syntax across multiple apps
Published 07/06/17.
Updated 07/31/17. Changelog