Hook allows you to link "items of content" on your Mac so that you can quickly hop between them using a LaunchPad / Alfred type interface. For instance you can link a file with an email with a website. These scripts allow you to link these things to an individual TaskPaper task. You can jump directly to any of these, or create a new (for example) nvUltra document for this task.
- It requires Keyboard Maestro
- It requires you to add an id tag to a task (e.g.
@tid(Mi3yS)
). There is a Keyboard Maestro macro that will generate these for you.
- Copy the text from hook_tp_script.scpt into the "Get Address" section of a new TaskPaper script in Hook (more information here).
- Import the tp_km_macros.kmmacros macros into Keyboard Maestro. Don't restrict the TaskPaper macros to only run in TaskPaper, or else they can't be run by Hook.
- For a task you want hook to, add an id using the format
@tid(xxxxx)
where xxxxx is a string of letters and numbers that are unique to that task. You can generate this by entering;id
to trigger one of the Keyboard Maestro macros - Trigger hook while the cursor is on the line of the task to open hooks to that task, or to copy a hook to that task to link to another.
- Use the "Create New" feature of Hook to link a task to a new text file (e.g. in nvUltra) to store and retrieve unlimited notes about a task.
- Projects and notes can be hooked to in the same way.
- The Hook script runs a KM macro which looks for the id using a RegEx. If found it passes the ID and task name back to the Hook script.
- If there is no id for the task a hook to the document is created.
- When linking to a task, a URL is created using the the scheme
kmtrigger://macro=tp3_open_taskpaper_task_url&value=<id>
. Opening this link will call the macrotp3_open_taskpaper_task_url
passing in the task ID. This uses the TaskPaper API to find the task and focus on it.
- It's possible this can be done without Keyboard Maestro.
- The Hook "Get Address" script could extract the Id and text directly without calling KM.
- A
kmtrigger
is unnecessary if the "Open Item" script for TaskPaper is implemented with a new scheme (e.g.TaskPaper://
). That would require Applescript to do the same thing as thetp3_open_taskpaper_task_url
KM Macro.
- If there is no
@tid
tag on a task when Hook is opened, Hook could add it first before hooking.