Cite&Write with OmniOutliner

This script it intended to allow for the easy addition of citations from documents stored in DT whilst writing in OmniOutliner . The citations are not meant to be academically rigorous or to conform to a particular standard (although they could be made so) but may be useful for lawyers or journalists who keep their material in structured groups.

Each row in OmniOutliner has three parts - The Topic field, for writing, the Quotation field for keeping a copy of the passage from the DT document and the row note field for keeping the citations themselves. Later on the OO document could be exported to Microsoft Word and the citations converted to footnotes.


  • Open an omnioutliner document with at least a column headed “Quotation” (I use a standard Omnioutliner document customised to my requirement and stored as a template in the templates folder accessible through the "Open scripts folder menu item)

  • Open a Devonthink document, either a pdf or an rtf and highlight text

  • Run the script

  • Choose the citation format from the list

(if you don’t see the row note field you may have to choose View->Show all notes from the Omnioutliner menus)


  • This script places a hyperlinked citation to the currently open DT document in the Notes field of a selected OO row and places the selected text in the Quotation cell of the OO row. New quotations and citations are added as a new row after the selected row or at the end of the document

Hyperlinked citations will link to, in the the case of pdf documents, the page, an in the case of rtf documents through a text search to the paragraph.


  • An OmniOutliner document must be open.
  • The OmniOutliner document must have at least a columns called “Quotation”.

Quotation formats:

At the moment the script has three possible citations formats:

  • The name of the document and the page i.e “Entropy in Judicial Decision Making : 434”

  • The name of the parent group, the name of the document and the page. Thus where the parent group is the name of the author and the name of the document is the paper the citation will be “World Law Journal, Entropy in Judicial Decision Making : 434”. Where the document appears in more than one group, the list will have a citation referencing each of the the groups. For these purposes a tag also counts as a group. So if the article is tagged with the author “Khumalo, J” then there will be an option to the cite the document as “Khumalo, J: Entropy in Judicial Decision Making : 434”.

Write&Cite screenshot.jpg

It is possible to construct your own citation formats. Please see the comments in the relevant section of the code. I would think its quite possible to extract references from Bookends, Papers or Endnotes but I have no experience of using them. Pdfs imported from Bookends have amongst other properties, the Author property set, which could easily be used as part of the citation creation.


[edit 20150502] Thank you to korm for pointing out the behaviour relating to the insertion of citations was confusing. New quotations and citations are now always added as a new row after the selected row or at the end of the document. This is the same behavior as in this script [url]Put up Example page] The ability to add an additional citation to an existing row has been removed.
[edit 20160929]Bates numbering scheme updated for more flexible format. Correctly deals with accented characters thanks to hermeneut
Cite&Write with OmniOutliner (26.7 KB)

1 Like

Wow, thank you for this. I’m currently prepping for a very document intensive and witness intensive trial later this year, and have been debating between doing witness outlines in Circus Ponies Notebooks (and embedding exhibits and documents directly in the notebook outline), and doing them in OmniOutliner, with the documents themselves stored externally in DEVONthink. This could be very handy.

Great stuff – and really generous for a busy professional to take his time to share. Thanks, Frederiko!

Brilliant stuff, Frederiko! Let me echo korm’s praises. Thanks for your time and efforts. :smiley:

This is indeed a very nice script. If the OO documents are opened in OmniOutliner iOS, and the corresponding document has been synced to DEVONthink to Go, then the links are maintained and works well there also.

One question that I have, and I confess I am lazy and have not examined in detail the script, is that I am also proposed a citation format for each tag that is assigned to the document. For a PDF the format is:

, :
, :
, :

Is this the expected citation format behavior?

This is an very big and unexpected bonus ! Thanks for discovering it Greg. Its instantly going to make my iPad so much more useful.

The relevant portion of the codes that generates citations is very straightforward. The general idea is that you can change it to extract what every relevant piece of information, such as Author, or portion of the document hierarchy that is useful in the creation of the citation.

	-- The following code constructs the list of possible citations formats
	-- Any new citation format should be added with 'set end of LinkList to { [new citation format] }'
	-- Variables:
	--  theName is the name of the document
	--  displayPage is the page of the document, where the first page of a document is page 1 or a Bates number
	--  theDoc is the content record for the displayed document
	set end of linkList to {theName & displayPage}
	repeat with theParent in every parent of theDoc
		set end of the linkList to name of theParent & ", " & theName & displayPage
	end repeat

The behaviour you are seeing is the expected behaviour. The citation is constructed in the format [Parent],[Name of document] : [Page number]. A document may have a number of parents where the document is replicated and these may be both folders and tags.