View Single Post
--
A rough draft of a script which builds on the earlier OF to OPML exporter adding:
  1. Export to the iThoughts formats .itmz and .itm, and to plain tab-indented .txt, as well as to Markdown and FoldingText .todo mode,
  2. some scope for customising (filtering) the set of OmniFocus data which is exported,
  3. some basic options for customising the colors, expansion pattern, etc in iThoughtsHD.

If you create a small and simple iThoughtsHD file (.itmz or unzipped .itm), consisting only of a root node and some coloured top-level branches (anything bigger will slow things down) you can give its pathname in the pstrTemplate property in the header of the script, which should then pick up the main formatting settings of the template, and the set of colours used in its top-level branches.

I attach a sample pastel.itm template, and a bright.itmz template (.itmz files are zipped 'map.itm' files).

Anyone prepared to dip cautiously into SQL (unsupported and at their own risk) should be able to customise the set of data exported by adjusting some properties at the head of the script.

For iThoughtsHD exports, the -c or --collapse switch allows you to specify which levels of the diagram (root=1) are collapsed.

The script is attached, with templates, below.

Note: requires OS X 10.7 and above (Python 2.7)

For reference, its header looks like this:

Code:
-- Copyright (C) 2012 Robin Trew
--
-- Permission is hereby granted, free of charge, 
-- to any person obtaining a copy of this software 
-- and associated documentation files (the "Software"), 
-- to deal in the Software without restriction, 
-- including without limitation the rights to use, copy, 
-- modify, merge, publish, distribute, sublicense, 
-- and/or sell copies of the Software, and to permit persons 
-- to whom the Software is furnished to do so, 
-- subject to the following conditions:

-- *******
-- The above copyright notice and this permission notice 
-- shall be included in ALL copies 
-- or substantial portions of the Software.
-- *******

-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 
-- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 
-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 
-- OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

property pTitle : "Export OmniFocus data"
property pVer : "0.021"
property pAuthor : "Robin Trew"
property pSite : "Orginally published on http://forums.omnigroup.com"


property plstFormats : {"OPML", "ITM", "ITMZ", "TXT", "MD", "FT"}

-- OPTION STRINGS, including SQL filter strings
property pstrCollapseLevels : "4"
property pstrTemplate : "" -- Filename of small .itm or .itmz template to look for in same folder as script (for colors etc)
property pstrOutFolder : (path to desktop)

-- SQL filter notes
-- 1. Comma will be translated to AND
-- 2. Neither OR nor bracketing is supported
-- 3. Status strings should not be quoted - ie status = [active|done|inactive|dropped]
-- 4. As usual, the [ = | != ] operators  can not be used with null. Use [is null | is not null]
-- 5. For ALL use the simple filter 1, and for none, use 0
-- No Inbox tasks would be: property psqlInboxFilter : 0

property psqlFolderFilter : "effectiveActive = 1"
property psqlSinglesHoldersFilter : "folderEffectiveActive = 1, status = active, dateCompleted is null"
property psqlProjectFilter : "folderEffectiveActive = 1, status = active, dateCompleted is null"
property psqlTaskFilter : "effectiveContainingProjectInfoActive = 1, dateCompleted is null"
property psqlInboxFilter : "1" -- edit this to "1" for ALL inbox entries, or sth like "dateCompleted is null" to filter

-- SOME ALTERNATIVES
-- Don't show Inbox:
-- property psqlInboxFilter : 0

-- Exclude taskless projects
-- property psqlProjectFilter : "numberOfRemainingTasks > 0, folderEffectiveActive = 1, status = active, dateCompleted is null"

-- Exclude Projects and tasks with future start dates
-- property psqlProjectFilter : "taskBlockedByFutureStartDate=0, folderEffectiveActive = 1, status = active, dateCompleted is null"
-- property psqlTaskFilter : "BlockedByFutureStartDate=0, effectiveContainingProjectInfoActive = 1, dateCompleted is null"

-- OPTION FLAGS
property pblnIncludeOFLinks : false
property pblnIncludeNotes : true
property pblnRecurInfo : false -- prepend any Task Recurrence info to note
Attached Files
File Type: zip OF2MindMap-022.zip (46.9 KB, 3105 views)

Last edited by RobTrew; 2012-10-09 at 11:06 PM.. Reason: Ver 22 – Improves link formatting for MD/FT (flipping any (url)[name] pairs in OF notes to [name](url))