├── Template.mindnode
├── viewState.plist
├── style.mindnodestyle
│ ├── contents.xml
│ └── metadata.plist
└── contents.xml
├── Template.oo3template
└── contents.xml
├── Template.mindmanager
├── PDFPreview.pdf
├── xsd
│ ├── MindManagerDelta.xsd
│ ├── MindManagerCore.xsd
│ ├── MindManagerPrimitive.xsd
│ └── MindManagerApplication.xsd
└── Document.xml
├── Template.md
├── Template.opml
├── map.itm
├── README.md
└── ExtraInfoPlus.applescript
/Template.mindnode/viewState.plist:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ttscoff/ExtraInfoPlus/HEAD/Template.mindnode/viewState.plist
--------------------------------------------------------------------------------
/Template.oo3template/contents.xml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ttscoff/ExtraInfoPlus/HEAD/Template.oo3template/contents.xml
--------------------------------------------------------------------------------
/Template.mindmanager/PDFPreview.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ttscoff/ExtraInfoPlus/HEAD/Template.mindmanager/PDFPreview.pdf
--------------------------------------------------------------------------------
/Template.mindnode/style.mindnodestyle/contents.xml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ttscoff/ExtraInfoPlus/HEAD/Template.mindnode/style.mindnodestyle/contents.xml
--------------------------------------------------------------------------------
/Template.mindnode/style.mindnodestyle/metadata.plist:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ttscoff/ExtraInfoPlus/HEAD/Template.mindnode/style.mindnodestyle/metadata.plist
--------------------------------------------------------------------------------
/Template.md:
--------------------------------------------------------------------------------
1 | Title: %%TITLE%%
2 | Date: %%DATE%%
3 | Source: %%FILEPATH%%
4 |
5 | # %%TITLE%%
6 |
7 |
8 |
9 | > Related: [%%FILENAME%%](%%FILEPATH%%)
10 |
--------------------------------------------------------------------------------
/Template.opml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | %%TITLE%%
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/map.itm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CanvasStyle
6 | 0
7 | Level1LinkStyle
8 | 5
9 | Level1LinkTapered
10 | 1
11 | LevelNLinkStyle
12 | 3
13 | MapAutoAlign
14 | 1
15 | MapData
16 | <iThoughtsRelative version="2.0" app="iThoughtsX" appver="1.1"><topics>
17 | <topic x="0.0" y="0.0" txt="%%TITLE%%" fnt="12.000000">
18 | </topic>
19 | </topics><relationships>
20 | </relationships>
21 | </iThoughtsRelative>
22 | MapLayout
23 | 1
24 | MapViewStyle
25 | 0
26 | RadialLayout
27 | 0
28 | Rainbow
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Extra Info++
2 |
3 | A script to provide tag-based linking to external notes from within TaskPaper documents, allowing you to elaborate on tasks and ideas, collect additional resources and generally keep your TaskPaper files void of dozens of notes.
4 |
5 | The heavy lifting on this was all done by [Pedro Lobo](http://palobo.tumblr.com)
6 |
7 | *Original Copyright (C) 2012 Pedro Lobo*
8 |
9 | **Modified by Brett Terpstra 2015:**
10 |
11 | * Recognize `[[wiki links]]` in task text, automatically open them in the first item in the workList (defaults to nvALT)
12 | * Simplified path setup
13 |
14 | *Modified by Brett Terpstra 2013:*
15 |
16 | * Added basic template capabilities and additional app examples
17 | * If the tag value is empty, the task title is used for filename and templating
18 | * Routines for handling peculiarities of each app
19 |
20 | This is a hot mess as far as the AppleScript goes (my fault). Too many logic forks and redundancies were introduced in this process. It works well, but it's not as easily extensible as I'd like. Feel free to fix it...
21 |
22 | ## Setup
23 |
24 | 1. Open the `ExtraInfoPlus.applescript` file in AppleScript Editor and save it as a script in `~/Library/Scripts/Applications/TaskPaper`.
25 | 2. You'll need to edit the template path to point to wherever you put this repo.
26 | 3. Edit the docPath values for each app you want to use. These are the locations where new note files will be created for each app.
27 | 4. Use a launcher like [FastScripts](http://www.red-sweater.com/fastscripts/) for hotkey access to the script from within TaskPaper.
28 |
29 | ## Apps
30 |
31 | * `@map` triggers **MindNode** using *Template.mindnode*
32 | * `@mmap` triggers **Mindjet MindManager** using *Template.mindmanager*
33 | * `@mapx` triggers **iThoughtsX** using *map.itm*
34 | * `@outline` triggers **Tree 2** using *Template.opml*
35 | * `@note` triggers **nvALT** using *Template.md*
36 |
37 | ## Template variables
38 |
39 | * %%TITLE%% is generated from the tag value, or the task name if that's empty
40 | * %%DATE%% is the ISO date at the runtime
41 | * %%FILENAME%% is the document title of the originating TaskPaper document
42 | * %%FILEPATH%% is the originating TaskPaper document as a file URL
43 |
--------------------------------------------------------------------------------
/Template.mindnode/contents.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | author
6 |
7 | comments
8 |
9 | isUsingConstrainedLayout
10 |
11 | keywords
12 |
13 | mindMap
14 |
15 | associations
16 |
17 | color
18 | {1.000, 1.000, 1.000, 1.000}
19 | mainNodes
20 |
21 |
22 | contentAlignment
23 | 1
24 | fillColor
25 | {1.000, 1.000, 1.000, 1.000}
26 | isDecreasingBranchThickness
27 |
28 | isDrawingFill
29 |
30 | isLeftAligned
31 |
32 | location
33 | {0, 0}
34 | nodeID
35 | 11D138EB-0A9B-43C3-BCF1-2374BE361B4C
36 | strokeColor
37 | {0.500, 0.500, 0.500, 1.000}
38 | strokeStyle
39 | 0
40 | strokeWidth
41 | 2
42 | subnodes
43 |
44 | title
45 |
46 | constrainedWidth
47 | 300
48 | htmlText
49 | <p style='color: rgba(0, 0, 0, 1.000000); font: 14px "Helvetica Neue"; text-align: left; -cocoa-font-postscriptname: "HelveticaNeue"; '>%%TITLE%%</p>
50 | shrinkToFitContent
51 | 1
52 | text
53 | {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf390
54 | {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;}
55 | {\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
56 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
57 |
58 | \f0\fs28 \cf2 %%TITLE%%}
59 |
60 |
61 |
62 |
63 | printInfo
64 |
65 | BAtzdHJlYW10eXBlZIHoA4QBQISEhAtOU1ByaW50SW5mbwGEhAhOU09iamVjdACFkoSE
66 | hBNOU011dGFibGVEaWN0aW9uYXJ5AISEDE5TRGljdGlvbmFyeQCUhAFpCJKEhIQITlNT
67 | dHJpbmcBlIQBKxZOU0hvcml6b250YWxseUNlbnRlcmVkhpKEhIQITlNOdW1iZXIAhIQH
68 | TlNWYWx1ZQCUhAEqhIQBY50BhpKEmZkNTlNSaWdodE1hcmdpboaShJuchIQBZp5IhpKE
69 | mZkMTlNMZWZ0TWFyZ2luhpKEm5ygnkiGkoSZmRVOU0hvcml6b25hbFBhZ2luYXRpb26G
70 | koSbnISXlwKGkoSZmRROU1ZlcnRpY2FsUGFnaW5hdGlvboaShJucpZcAhpKEmZkUTlNW
71 | ZXJ0aWNhbGx5Q2VudGVyZWSGkpqShJmZC05TVG9wTWFyZ2luhpKEm5ygnlqGkoSZmQ5O
72 | U0JvdHRvbU1hcmdpboaShJucoJ5ahoaG
73 |
74 | title
75 | %%TITLE%%
76 | version
77 | 4
78 |
79 |
80 |
--------------------------------------------------------------------------------
/Template.mindmanager/xsd/MindManagerDelta.xsd:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Template.mindmanager/xsd/MindManagerCore.xsd:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/ExtraInfoPlus.applescript:
--------------------------------------------------------------------------------
1 | -- TaskPaper Actions | Extra Info++
2 | --
3 | -- For use with TaskPaper and Alfred
4 | -- For further instructions read the README.md or visit http://palobo.tumblr.com
5 | --
6 | -- Copyright (C) 2012 Pedro Lobo
7 | --
8 | -- Modified by Brett Terpstra 2015
9 | -- Added rudimentary templating and additional examples
10 | --
11 | -- Updated 8/10/15
12 | -- Added ability to find [[wiki links]] in task text, open using first item in workList
13 | -- Use ML+ notification center if Growl isn't running
14 | --
15 | -- Template variables
16 | -- %%TITLE%% is generated from the tag value, or the task name if that's empty
17 | -- %%DATE%% is the ISO date at the runtime
18 | -- %%FILENAME%% is the document title of the originating TaskPaper document
19 | -- %%FILEPATH%% is the originating TaskPaper document as a file URL
20 | --
21 | -- Configure settings below
22 | --
23 | -- The base folder all paths will be relative to. If blank, use absolute paths
24 | property baseFolder : "/Users/ttscoff/Dropbox/"
25 | -- The folder where your templates are stored, must end in trailing slash
26 | property templateFolder : "Notes/Templates/"
27 | -- Your keywords for app triggers, and their associated target paths, template names, extension and app name
28 | set workList to {{"note", "node", "map", "mmap", "outline"}, ¬
29 | {docPath:"nvALT2.2/", template:"Template.md", ext:"md", appname:"nvALT"}, ¬
30 | {docPath:"Notes/Brainstorming/", template:"Template.mindnode", ext:"mindnode", appname:"MindNode Pro"}, ¬
31 | {docPath:"Notes/Brainstorming/", template:"map.itm", ext:"itmz", appname:"iThoughtsX"}, ¬
32 | {docPath:"Notes/Brainstorming/", template:"Template.mindmanager", ext:"mmap", appname:"Mindjet MindManager"}, ¬
33 | {docPath:"Notes/Brainstorming/", template:"Template.opml", ext:"opml", appname:"Tree 2"}}
34 |
35 |
36 | -- Change nothing bellow this point unless you know what you're doing. Magic starts here.
37 | property srcPath : missing value
38 | property fileName : missing value
39 | property dateNow : missing value
40 | set dateNow to do shell script "date '+%Y-%m-%d %H:%M'"
41 |
42 | tell application "TaskPaper"
43 | my displayMessage("Operations", "Opened File", "Successfully opened")
44 | set _doc to document of window 1
45 | set _file to file of _doc
46 | set srcPath to "file://" & POSIX path of _file
47 | set _filename to name of _doc as string
48 | set fileName to rich text 1 thru ((offset of ".taskpaper" in _filename) - 1) of _filename
49 | tell selected entry
50 | set marker to 0
51 | set tagList to name of tags
52 | set watchList to list 1 of workList
53 | set propList to rest of workList
54 | repeat with _item in watchList
55 | set marker to marker + 1
56 | repeat with _tag in tagList
57 | if _tag as rich text = _item as rich text then
58 | set _name to value of tag named _tag
59 | if _name is missing value or _name is "" then
60 | set _name to text content
61 | end if
62 | set rec to record marker of propList
63 | my accessInfo(_name, baseFolder & (docPath of rec), ext of rec, appname of rec, template of rec)
64 | end if
65 | end repeat
66 | end repeat
67 |
68 | set wikiLink to my findBetween("[[", "]]", text content)
69 | if (count of wikiLink) > 0 then
70 | set rec to record 1 of propList
71 | my accessInfo(wikiLink, baseFolder & (docPath of rec), ext of rec, appname of rec, template of rec)
72 | end if
73 | end tell
74 | end tell
75 |
76 |
77 |
78 | to accessInfo(_name, _path, _ext, _appname, _template)
79 | set extraInfo to _path & snr("/", "_", _name) & "." & _ext
80 | set extraAlias to extraInfo as POSIX file
81 | set _template_path to templateFolder & _template
82 | tell application "Finder"
83 |
84 | if exists extraAlias then
85 | try
86 | if _appname is "nvALT" then
87 | do shell script "open 'nvalt://find/" & _name & "'"
88 | else
89 | do shell script "open -a " & quoted form of _appname & " " & quoted form of extraInfo
90 | end if
91 | my displayMessage("Operations", "Opened File", "Successfully opened " & _name & "." & _ext)
92 | on error errStr number errorNumber
93 | my displayMessage("Errors", "Error", "Problem Opening " & _name & "." & _ext & " : " & errStr & "(" & errorNumber & ")")
94 | end try
95 | else
96 | try
97 | if _appname is "iThoughtsX" then
98 | do shell script "cp " & quoted form of _template_path & " " & _path & _template
99 | my updateTemplate(_path & _template, _name, _appname, _path)
100 | do shell script "open -a " & quoted form of _appname & " " & quoted form of extraInfo
101 | else if _appname is "Mindjet MindManager" then
102 | set tmpFolder to extraInfo & ".tmp"
103 | do shell script "cp -r " & quoted form of _template_path & " " & quoted form of tmpFolder
104 | my updateTemplate(tmpFolder, _name, _appname, _path)
105 | do shell script "open -a " & quoted form of _appname & " " & quoted form of extraInfo
106 | else
107 | do shell script "cp -r " & quoted form of _template_path & " " & quoted form of extraInfo
108 | my updateTemplate(extraInfo, _name, _appname, _path)
109 | if _appname is "nvALT" then
110 | do shell script "open \"nvalt://find/" & _name & "\""
111 | else
112 | do shell script "open -a " & quoted form of _appname & " " & quoted form of extraInfo
113 | end if
114 | end if
115 | my displayMessage("Operations", "Created New File", "Successfully Created and Opened " & _name & "." & _ext)
116 | on error errStr number errorNumber
117 | my displayMessage("Errors", "Error", "Problem Creating/Opening " & _name & "." & _ext & " : " & errStr & "(" & errorNumber & ")")
118 | end try
119 |
120 | end if
121 | end tell
122 |
123 | end accessInfo
124 |
125 | to updateTemplate(_template, _name, _app, _docPath)
126 | if _app is "MindNode Pro" then
127 | set template_file to _template & "/contents.xml"
128 | else if _app is "Mindjet MindManager" then
129 | set template_file to _template & "/Document.xml"
130 | else
131 | set template_file to _template
132 | end if
133 | set _contents to readFile(template_file)
134 | set _res to snr("%%TITLE%%", _name, _contents)
135 | set _res to snr("%%DATE%%", dateNow, _res)
136 | set _res to snr("%%FILEPATH%%", srcPath, _res)
137 | set _res to snr("%%FILENAME%%", fileName, _res)
138 | set eof of template_file to 0
139 | writeFile(template_file, _res)
140 | if _app is "iThoughtsX" then
141 | set _target to snr("/", "_", _name) & ".itmz"
142 | do shell script "cd " & _docPath & " && zip " & quoted form of _target & " map.itm && rm map.itm"
143 | else if _app is "Mindjet MindManager" then
144 | set _target to _name & ".mmap"
145 | do shell script "cd " & quoted form of _template & " && zip ../" & quoted form of _target & " * && cd .. && rm -rf " & quoted form of _template
146 | end if
147 | end updateTemplate
148 |
149 | to readFile(unixPath)
150 | set foo to (open for access (POSIX file unixPath))
151 | set txt to (read foo for (get eof foo) as «class utf8»)
152 | close access foo
153 | return txt
154 | end readFile
155 |
156 | on writeFile(unixPath, _content)
157 | set newFile to POSIX file unixPath
158 | open for access newFile with write permission
159 | set eof of newFile to 0
160 | write _content to newFile
161 | close access newFile
162 | end writeFile
163 |
164 | to displayMessage(msgName, msgTitle, msgText)
165 |
166 | -- Check to see if it's running
167 | tell application "System Events"
168 | set growlRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0
169 | end tell
170 |
171 | -- Register Growl
172 | if growlRunning then
173 | tell application id "com.Growl.GrowlHelperApp"
174 | -- Make a list of all the notification types
175 | -- that this script will ever send:
176 | set the allNotificationsList to ¬
177 | {"Operations", "Errors"}
178 |
179 | -- Make a list of the notifications
180 | -- that will be enabled by default.
181 | -- Those not enabled by default can be enabled later
182 | -- in the 'Applications' tab of the Growl preferences.
183 | set the enabledNotificationsList to ¬
184 | {"Operations", "Errors"}
185 |
186 | -- Register our script with growl.
187 | -- You can optionally (as here) set a default icon
188 | -- for this script's notifications.
189 | register as application ¬
190 | "TaskPaper Extended Notes" all notifications allNotificationsList ¬
191 | default notifications enabledNotificationsList ¬
192 | icon of application "TaskPaper"
193 | end tell
194 | end if
195 |
196 | -- Display the Message
197 | if growlRunning then
198 | tell application id "com.Growl.GrowlHelperApp"
199 | notify with name ¬
200 | msgName title ¬
201 | msgTitle description ¬
202 | msgText application name ¬
203 | "TaskPaper Extended Notes"
204 | end tell
205 | else
206 |
207 | display notification msgText with title msgName
208 |
209 | end if
210 |
211 | end displayMessage
212 |
213 | on findBetween(startTag, endTag, theString)
214 | set atid to text item delimiters
215 | set text item delimiters to startTag
216 | set _output to ""
217 | set textItems to text items of theString
218 | if (count of textItems) > 1 then
219 | set _right to item 2 of textItems
220 | set text item delimiters to endTag
221 | set textItems to text items of _right
222 | if (count of textItems) > 1 then
223 | set _output to item 1 of textItems as string
224 | end if
225 | end if
226 |
227 | set text item delimiters to atid
228 | return _output
229 | end findBetween
230 |
231 | --search and replace function for template
232 | on snr(tofind, toreplace, theString)
233 | set atid to text item delimiters
234 | set text item delimiters to tofind
235 | set textItems to text items of theString
236 | set text item delimiters to toreplace
237 | if (class of theString is string) then
238 | set res to textItems as string
239 | else -- (assume Unicode)
240 | set res to textItems as Unicode text
241 | end if
242 | set text item delimiters to atid
243 | return res
244 | end snr
245 |
246 | -- urlencode
247 | on urlencode(theText) -- http://harvey.nu/applescript_url_encode_routine.html
248 | set theTextEnc to ""
249 | repeat with eachChar in characters of theText
250 | set useChar to eachChar
251 | set eachCharNum to ASCII number of eachChar
252 | if eachCharNum = 32 then
253 | set useChar to "+"
254 | else if (eachCharNum ≠ 42) and (eachCharNum ≠ 95) and (eachCharNum < 45 or eachCharNum > 46) and (eachCharNum < 48 or eachCharNum > 57) and (eachCharNum < 65 or eachCharNum > 90) and (eachCharNum < 97 or eachCharNum > 122) then
255 | set firstDig to round (eachCharNum / 16) rounding down
256 | set secondDig to eachCharNum mod 16
257 | if firstDig > 9 then
258 | set aNum to firstDig + 55
259 | set firstDig to ASCII character aNum
260 | end if
261 | if secondDig > 9 then
262 | set aNum to secondDig + 55
263 | set secondDig to ASCII character aNum
264 | end if
265 | set numHex to ("%" & (firstDig as string) & (secondDig as string)) as string
266 | set useChar to numHex
267 | end if
268 | set theTextEnc to theTextEnc & useChar as string
269 | end repeat
270 | return theTextEnc
271 | end urlencode
272 |
273 | -- This program is free software: you can redistribute it and/or modify
274 | -- it under the terms of the GNU General Public License as published by
275 | -- the Free Software Foundation, either version 3 of the License, or
276 | -- (at your option) any later version.
277 | --
278 | -- This program is distributed in the hope that it will be useful,
279 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of
280 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
281 | -- GNU General Public License for more details.
282 | --
283 | -- You should have received a copy of the GNU General Public License
284 | -- along with this program. If not, see .
285 |
--------------------------------------------------------------------------------
/Template.mindmanager/xsd/MindManagerPrimitive.xsd:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Template.mindmanager/Document.xml:
--------------------------------------------------------------------------------
1 |
2 | mmarch://Preview.png
--------------------------------------------------------------------------------
/Template.mindmanager/xsd/MindManagerApplication.xsd:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------