Tinderbox Forum

Export for novices

I am not a computer programmer but a mere lawyer. I can work out how to create notes and gather them with agents. The notes have (1) a title (2) start date (3) end date (4) text. I can display them in Outliner View with columns I get a very useful document. I want to give it to a colleague who uses OmniOutliner. How do I do it? I have read the stuff about templates but do not understand it. How do I make the template act on my chosen note? And how do I ask the template to draw across the four attributes that I have mentioned?

Thanks.

Bryan Heaney
Edinburgh

1 Like

For export to OmniOutliner, I would use a format called OPML which Tinderbox generates quite happily. While I knock up a simple demo, some questions:

  • How are you deciding which notes are to be expected?
  • Will the exported notes be nested, i.e. some notes being children of others?

As per your note, the expectation is that we must transfer, at minimum, the following attributes:

  1. Note title ($Name)
  2. A start date (assumed $StartDate)
  3. An end date (assumed $EndDate)
  4. The note’s text ($Text)

Thanks so much. Ideally I want to export notes that I have gathered using an agent, I think that means they won’t be nested.

You have identified the four attributes I want to export.

BH

1 Like

OK, testing with Tinderbox v8.5.1 and OmniOutliner (Pro) v5.5.3 there are some problems. This is because although OmniOutliner still imports OPML the user will need to re-save the file in OmniOutliner format and then set the correct data types. Not impossible but a bit of a faff.

Given the above and not knowing the locale of your colleague, we have to consider day & month order. Is 03/05/2020 5 March, as in the US, or 3 May as in most of the rest of the globe. For that reason we’ll export in yyyy-mm-dd format. When the imported OPML in OmniOutliner is saved in OmniOutliner native file format, the StartDate and EndDate data type can be changed from string to date and the date will render in more normal day/month or month/day order of the recipients system.

Before you ask, can OmniOutliner import some other format, the answer is No; the app has no ‘import’ as such but rather it can open some other formats which can then be ‘saved as’ into OmniOutliner native format. Can Tinderbox create a native OmniOutliner format file? No, no really as that ‘file’ is actually a complex folder of files disguised as a single file.

Lastly, another approach is to use AppleScript, but let’s park that for now.

Preamble explained, the next post will be files.

Here is a test doc:

Sample-OPML-export.tbx (110.3 KB)

To export the OPML, select the ‘Export Agent’ in the view pane, then use menu File ▸ Export Selected Note. Save the resulting file.

In OmniOutliner, use menu File ▸ Open, and locate you OPML file to open it in OmniOutliner. Now, open menu File, press the Option key so the ‘Duplicate’ option in the menu changes to ‘Save As’. Click that and in the save dialog, choose OmniOutliner format.

Now you have a proper OmniOutliner file, for the column head for each date column you can right-click the header and choose Format ▸ Date.

Sorry if that’s complicated but the limitation is in the OmniOutliner app rather than Tinderbox.

Here is a ZIP file holding the above TBX, the exported OPML file as created by Tinderbox and the same imported to OmniOutliner and saved as an OmniOutliner-format file with the date column data types set (as above).

Sample-OPML-export.zip (63.1 KB)

Sorry for the delay. I don’t recall the OmniOutliner end being so complicated in older version of the app, but it’s a good example of apps not giving thought to data input from file. :roll_eyes:

1 Like

Works like magic. Later, I will work out how you did it!

Great! Sorry it’s such a faff!

For the Tinderbox end, to use the templates in a new (or existing other ) TBX document:

  • Add the ‘HTML’ built-in template. This ensures the ‘Prototypes’ and ‘Templates’ containers are added.
  • Copy /paste the two templates from my demo to the the Templates container in the other doc.
  • Check the templates use the ‘HTML’ prototype, if not set it for them (see how).
  • Select the agent you will use for the export and open the HTML Inspector, Export tab. Using the latter:
    • Change the Extension value to .opml (don’t forget the opening full-stop). The default value is .html but we’ll not be exporting HTML here.
    • Optionally, change the Filename value to something useful, otherwise the name—as in my demo—is derived from the source note name
    • Set the Template pop-up to use the ‘OPML-wrapper’ template (the pop-up lists the full path to the template). Don’t worry aout the ‘OPML-item’ template as this gets set for you be the wrapper template.
  • You’re now good to go.

If you need to add or another attribute edit the ‘OPML-item’ template. To add the value of $SomeAttribute, add this code:

 SomeAttribute="^value($SomeAttribute)^"

Notes on the above:

  • The insertion goes before the closing /> markup in the template
  • The code section above stasrts with a space. Whether inserting at the end of the code or inbetween others, ensure there is a space between each attribute’s code. You don’t need a space after the last code and the closing /> (but it doesn’t matter if there is one).
  • The initial name, here SomeAttribute is the name that will form the column head in the OmniOutliner-opened OPML file. It doesn’t have to be the same as the attribute name but spaces, punctuation aren’t allowed. If you need a space use an underscore instead. Note, once in OmniOutliner you can edit the column head to whatever you like.
  • For some data types, you may want to further format the exorted attribute value using .format(), as with the dates in my demo. That detail is left to the reader but see more on .format() (that page is about the older format() version of the same code but it shows the per data type variation and links to the .format() pages on them.

If you have OmniOutliner, you may find it useful to to do the OPML imporet and re-save yourself and so send the .oo5 OmniOutliner native format file to your colleague so thay can ‘just’ use it.

I hope that helps. :grinning:

1 Like

An AppleScript solution could be as follows:

tell front document of application "Tinderbox 8"
	tell selections
		set theNames to name
		set theStartDates to value of attribute "StartDate"
		set theEndDates to value of attribute "EndDate"
		set theTexts to value of attribute "Text"
	end tell
end tell

tell front document of application "OmniOutliner"
	repeat (4 - (column count)) times
		set newCol to make column
	end repeat
	repeat with i from 1 to length of theNames
		set newRow to make new row with properties {topic:item i of theNames} at after last row
		tell newRow
			set value of cell 1 to item i of theTexts
			set value of cell 3 to text 1 thru 10 of item i of theStartDates
			set value of cell 4 to text 1 thru 10 of item i of the theEndDates
		end tell
	end repeat
	tell column 3 to set {title, column type} to {"StartDate", datetime}
	tell column 4 to set {title, column type} to {"EndDate", datetime}
end tell
  1. Copy-paste script into Script Editor (in Applications > Utilities)
  2. (Before running the first time) make sure Script Editor and Tinderbox are listed and checked at System Preferences > Security & Privacy > Privacy > Accessibility.
  3. Have a “blank” OmniOutliner document open.
  4. Select the notes in Tinderbox that you want to export (I simply selected the notes collected within an agent).
  5. Click the triangle ‘run’ button in Tinderbox.

The script should then do the rest: export the values, set up date columns in OO if they don’t already exist, add rows as needed, etc.

Then, of course, save the OO document.

1 Like

Wow. I’ll try that too. Thanks for your help. BH

Dear Mark,

I see how that works. In the tbx outline, the notes are colour coded. For simplicity, say that if a note contains a statement of fact admitted by the opponent in the litigation I have coloured it green, if it a fact the plaintiff offers to prove it is yellow, and a fact the defendant offers to prove, it is red. How do I carry that over into the exported file? If I can’t do it visually, by colour coding, can it be done by inserting words, such as “ADMITTED” at the start of the note title?

Would it help if I sent the file? Could you give e a quick way to replace the name of the client everywhere it appears?

I’m finding the software very useful indeed. Do many litigators use it?

Yours sincerely,

Bryan


Bryan Heaney
Advocate
07739 639 078

Website: https://www.westwateradvocates.com/counsel/bryan-j-heaney/

My GDPR policy is available on request and on the Faculty of Advocates website: www.advocates.org.uk

In OPML (which I think is the medium here) it’s hard as the formal OPML spec doesn’t have a specified support for a colour notation. We can add custom OPML code be then it all depends on whether OmniOutliner both read that OPML data and applied it appropriately within that app. If a definite need, @sumnerg’s AppleScript approach might more easily be modified as it can read $Color value from the Tinderbox context and set that value on the appropriate OmniOutliner feature.

With the latter in mind are we talking $Color or $OutlineBackgroundColor, or both—as in:

Also where in OmniOutliner do you expect these colour(s) to be applied?

Yes, if you Private Message me on the forum you can upload a file (small if you can!) to the forum, or post a (private) URL for me to download a large file. File contents will be treated in confidence.

Possibly, but it depends on what ‘everywhere’ implies. So, whilst there is no’ replace X with Y in every possible attribute’ feature it can be done attribute by attribute for String and String-based (e.g. List) attributes, e.g.

$Text = $Text.replace("Brown","Smith");
$Name = $Name.replace("Brown","Smith");
...etc.

But, beware where names have literal meaning and stem other words. ‘Brown’ can be a Surname (aka Family Name) or a colour. ‘Brown’ is a stem of ‘Brownlee’ and you don’t want to end up with ‘Smithlee’. This just means you need to be careful with .replace() and use regular expressions (‘regex’) but I won’t diverge into regex minutiae here—let’s pcik that up separately if needed.

I’m certainly aware of a few in the US/UK. I don’t know email handles. I’d drop an email to @eastgate who will have a better idea and might be able to put you in touch with some. I certainly recall a UK barrister and a US commercial litigator using Tinderbox to track the complecities of cases, and a Canadian judge (with a travelling court in Inuit areas) who used Tinderbox as part of his working trial notes and research.

Also a guy in the same office building as Eastgate, Inc. made a run at making a Tinderbox-based case file. Note that is back in the old Tinderbox v5 codebase and I’m not sure if it was taken forward

† Disclaimer: I made a fair amount of background input into the document functionality (esp actions and such) albeit on a volunteer basis in my Tinderbox community support ‘hat’.

Hope that helps!

Thanks. I’m learning a lot. BH

1 Like

Could you explain how I would export to a format that Scrivener would import? I would like the outline in the imported scrivener document to show (1) note (2) startdate (3) enddate and (4) text.

Thanks.
Bryan

Scrivener is somewhat limited in this regard, in that it is limited to using OPML. Have you tried using the built-in template OPML? This can be added to your TBX using the File menu.

The template assumes you want to export a note and all its descendants, be that one part of the outline or the whole document.

With the template added, to export just a branch (i.e. container and below), select the container. Open the HTML Inspector, Export tab and select the ‘Scrivener’ template. Then use File menu → Export Selected note. This will create an OPML file that Scrivener should be able to ingest.

Note that even if your source note $Text use RTF feature, OPML text is limited to plain text. That is a limitation of the format choice and the format choice is a limitation of Scrivener. So if you want rich text support you need to go lobby at the Scrivener end of things as that will need supporting a format other than OPML.

Does that help?

Continuing the discussion from Export for novices:

Many thanks. I can export with the attributes that I used before. They include $Note, $Text, $Startdate and $Enddate. I then import the file into Scrivener. I can see the $Note and $Text but not the dates. What am I doing wrong, or will dates not come across?

Once I can use Tinderbox and Scrivener together that will be magic.

BH

Checking further, the default Tinderbox built-in template ‘Scrivener’ does not include $StartDate and $EndDate data but even when I add this, Scrivener doesn’t import it, even though it is valid OPML.

You need to take this problem to the Scrivener support/forum as you need a clear understanding of what OPML or subset of it Scrivener actually supports.

Thanks. I thought that might be the problem. Bh

1 Like

No problem. I just figure there’s no point exporting customised OPML if Scrivener won’t import it. If the latter is possible then we can help you customise your Tinderbox export template.